Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aarch64 #422

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .UUID
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Z3OWJ7W4NBCQ73W6FI7CPMAEP1D2QKGS
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
libnexio.a
libnexio.o
nexutil
*.cmd
templateram*.bin
vasip.bin
*ucode*.bin
*~
wip/*
28 changes: 28 additions & 0 deletions ChkHooks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh
# Requires bgrep from ... git clone https://github.com/tmbinc/bgrep
if [ $# -lt 1 ]
then
echo Usage: $0 firmware.bin
exit 0
fi
VER=`strings $1 |sed -n 's/\./_/g;/Version:/s/^\([0-9a-Z]*\)-.*Version: \(.*\) (.*/CHIP_VER_BCM\1, FW_VER_\2/p'`
echo Firmware ID: $VER

echo "R_98_97 R_Fware Function"
echo "=================================================================="
cat /opt/nexmon/patches/common/wrapper.c|grep "_98_97" |sed 's/).*\/\* \([a-zA-Z0-9_]*\)/, \1,/;s/\*\///'|tr -d ' '|cut -d, -f4,3,5 --output-delimiter=',' > /tmp/search.list
for line in `cat /tmp/search.list`;do
oldref=`echo $line|cut -d, -f1`
func=`echo $line|cut -d, -f2`
hook=`echo $line|cut -d, -f3`
found=`/opt/bgrep/bgrep "$hook" $1|cut -d: -f2`
printf "%0.8x " $oldref
echo $found $func
# echo "AT($VER, 0x$found)"
# AT(CHIP_VER_BCM43455c0, FW_VER_7_45_189, 0x57770)
done

exit 0
# strings /opt/nexmon/firmwares/bcm43430a1/7_45_98_94/brcmfmac43430-sdio.bin |sed -n '/Version:/s/.*Version: \(.*\) (.*/\1/p' -> FW
# grep -a -b --only-matching $'\x90\xf8\x76\x30\x10\xb5' cyfmac43430-sdio.bin|cut -d: -f1
sed 's/.\{2\}/\\\x&/g'
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,11 @@ buildtools: FORCE
@printf "\033[0;31m BUILDING BUILDTOOLS\033[0m\n"
$(Q)make -C $@

clean: FORCE
@printf "\033[0;31m CLEANING\033[0m\n"
$(Q)find . -iname "templateram*.bin" -delete
$(Q)find . -iname "vasip.bin" -delete
$(Q)find . -iname "*ucode*.bin" -delete
$(Q)find . -iname "flashpatches.c" -delete

FORCE:
24 changes: 24 additions & 0 deletions README.aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
NOTES
1) Integrated pre-built GNU cross-toolchain
-> https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrel/gcc-arm-9.2-2019.12-aarch64-arm-none-eabi.tar.xz
2) Buildtools
-> apt install libdl-dev xxd
3) Kernel Module
apt-get install kernel-headers-$(uname -r)
-> Paket kernel-headers-5.4.45-sunxi64 kann nicht gefunden werden.

snapshot https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/snapshot/linux-5.4.45.tar.gz
https://www.cyberciti.biz/tips/build-linux-kernel-module-against-installed-kernel-source-tree.html

Header installieren => sehr wenig "Material" im Zielverzeichnis ...
ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make headers_install

Kernel kompilieren => 2h
ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make -j2 vmlinux
root@nanopineoplus2:/opt/wip/linux-5.4.45# find . -iname "System.map" -ls
310289 3608 -rw-r--r-- 1 root root 3692909 Jul 16 01:18 ./System.map
root@nanopineoplus2:/opt/wip/linux-5.4.45# find . -iname ".config" -ls
308689 184 -rw-r--r-- 1 root root 185735 Jul 15 23:16 ./.config

./gen_mod_headers ./tmp ./linux-5.4.45 ./obj arm64 aarch64-linux-gnu-
Source tree not clean
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
binutils_configure='--enable-initfini-array --disable-nls --without-x --disable-gdbtk --without-tcl --without-tk --enable-plugins --disable-gdb --without-gdb --target=arm-none-eabi --prefix=/ '
gcc1_configure='--target=arm-none-eabi --prefix=/tmp/dgboter/bbs/moonshot-dsg-07--aarch64/buildbot/aarch64-none-linux-gnu--arm-none-eabi/build/build-arm-none-eabi/install// --with-gmp=/tmp/dgboter/bbs/moonshot-dsg-07--aarch64/buildbot/aarch64-none-linux-gnu--arm-none-eabi/build/build-arm-none-eabi/host-tools --with-mpfr=/tmp/dgboter/bbs/moonshot-dsg-07--aarch64/buildbot/aarch64-none-linux-gnu--arm-none-eabi/build/build-arm-none-eabi/host-tools --with-mpc=/tmp/dgboter/bbs/moonshot-dsg-07--aarch64/buildbot/aarch64-none-linux-gnu--arm-none-eabi/build/build-arm-none-eabi/host-tools --with-isl=/tmp/dgboter/bbs/moonshot-dsg-07--aarch64/buildbot/aarch64-none-linux-gnu--arm-none-eabi/build/build-arm-none-eabi/host-tools --disable-shared --disable-nls --disable-threads --disable-tls --enable-checking=release --enable-languages=c --without-cloog --without-isl --with-newlib --without-headers --with-multilib-list=aprofile'
gcc2_configure='--target=arm-none-eabi --prefix=/tmp/dgboter/bbs/moonshot-dsg-07--aarch64/buildbot/aarch64-none-linux-gnu--arm-none-eabi/build/build-arm-none-eabi/install// --with-gmp=/tmp/dgboter/bbs/moonshot-dsg-07--aarch64/buildbot/aarch64-none-linux-gnu--arm-none-eabi/build/build-arm-none-eabi/host-tools --with-mpfr=/tmp/dgboter/bbs/moonshot-dsg-07--aarch64/buildbot/aarch64-none-linux-gnu--arm-none-eabi/build/build-arm-none-eabi/host-tools --with-mpc=/tmp/dgboter/bbs/moonshot-dsg-07--aarch64/buildbot/aarch64-none-linux-gnu--arm-none-eabi/build/build-arm-none-eabi/host-tools --with-isl=/tmp/dgboter/bbs/moonshot-dsg-07--aarch64/buildbot/aarch64-none-linux-gnu--arm-none-eabi/build/build-arm-none-eabi/host-tools --disable-shared --disable-nls --disable-threads --disable-tls --enable-checking=release --enable-languages=c,c++,fortran --with-newlib --with-multilib-list=aprofile '
gdb_configure='--enable-initfini-array --disable-nls --without-x --disable-gdbtk --without-tcl --without-tk --with-expat --with-libexpat-prefix=/tmp/dgboter/bbs/moonshot-dsg-07--aarch64/buildbot/aarch64-none-linux-gnu--arm-none-eabi/build/build-arm-none-eabi/host-tools --with-python=yes --disable-binutils --disable-sim --disable-as --disable-ld --enable-plugins --target=arm-none-eabi --prefix=/ '
gmp_configure='--disable-maintainer-mode --prefix=/tmp/dgboter/bbs/moonshot-dsg-07--aarch64/buildbot/aarch64-none-linux-gnu--arm-none-eabi/build/build-arm-none-eabi/host-tools --disable-shared '
isl_configure='--prefix=/tmp/dgboter/bbs/moonshot-dsg-07--aarch64/buildbot/aarch64-none-linux-gnu--arm-none-eabi/build/build-arm-none-eabi/host-tools --with-gmp-prefix=/tmp/dgboter/bbs/moonshot-dsg-07--aarch64/buildbot/aarch64-none-linux-gnu--arm-none-eabi/build/build-arm-none-eabi/host-tools --disable-shared '
libexpat_configure='--prefix=/tmp/dgboter/bbs/moonshot-dsg-07--aarch64/buildbot/aarch64-none-linux-gnu--arm-none-eabi/build/build-arm-none-eabi/host-tools --without-docbook --without-xmlwf '
mpc_configure='--disable-maintainer-mode --prefix=/tmp/dgboter/bbs/moonshot-dsg-07--aarch64/buildbot/aarch64-none-linux-gnu--arm-none-eabi/build/build-arm-none-eabi/host-tools --with-gmp=/tmp/dgboter/bbs/moonshot-dsg-07--aarch64/buildbot/aarch64-none-linux-gnu--arm-none-eabi/build/build-arm-none-eabi/host-tools --with-mpfr=/tmp/dgboter/bbs/moonshot-dsg-07--aarch64/buildbot/aarch64-none-linux-gnu--arm-none-eabi/build/build-arm-none-eabi/host-tools --disable-shared '
mpfr_configure='--disable-maintainer-mode --prefix=/tmp/dgboter/bbs/moonshot-dsg-07--aarch64/buildbot/aarch64-none-linux-gnu--arm-none-eabi/build/build-arm-none-eabi/host-tools --with-gmp=/tmp/dgboter/bbs/moonshot-dsg-07--aarch64/buildbot/aarch64-none-linux-gnu--arm-none-eabi/build/build-arm-none-eabi/host-tools --disable-shared '
newlib_configure=' --disable-newlib-supplied-syscalls --enable-newlib-io-long-long --enable-newlib-io-c99-formats --enable-newlib-mb --target=arm-none-eabi --prefix=/'
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/* Provide support for both ANSI and non-ANSI environments. */

/* To get a strict ANSI C environment, define macro __STRICT_ANSI__. This will
"comment out" the non-ANSI parts of the ANSI header files (non-ANSI header
files aren't affected). */

#ifndef _ANSIDECL_H_
#define _ANSIDECL_H_

#include <newlib.h>
#include <sys/config.h>

/* ISO C++. */

#ifdef __cplusplus
#if !(defined(_BEGIN_STD_C) && defined(_END_STD_C))
#ifdef _HAVE_STD_CXX
#define _BEGIN_STD_C namespace std { extern "C" {
#define _END_STD_C } }
#else
#define _BEGIN_STD_C extern "C" {
#define _END_STD_C }
#endif
#if __GNUC_PREREQ (3, 3)
#define _NOTHROW __attribute__ ((__nothrow__))
#else
#define _NOTHROW throw()
#endif
#endif
#else
#define _BEGIN_STD_C
#define _END_STD_C
#define _NOTHROW
#endif

#ifndef _LONG_DOUBLE
#define _LONG_DOUBLE long double
#endif

/* Support gcc's __attribute__ facility. */

#ifdef __GNUC__
#define _ATTRIBUTE(attrs) __attribute__ (attrs)
#else
#define _ATTRIBUTE(attrs)
#endif

/* The traditional meaning of 'extern inline' for GCC is not
to emit the function body unless the address is explicitly
taken. However this behaviour is changing to match the C99
standard, which uses 'extern inline' to indicate that the
function body *must* be emitted. Likewise, a function declared
without either 'extern' or 'static' defaults to extern linkage
(C99 6.2.2p5), and the compiler may choose whether to use the
inline version or call the extern linkage version (6.7.4p6).
If we are using GCC, but do not have the new behaviour, we need
to use extern inline; if we are using a new GCC with the
C99-compatible behaviour, or a non-GCC compiler (which we will
have to hope is C99, since there is no other way to achieve the
effect of omitting the function if it isn't referenced) we use
'static inline', which c99 defines to mean more-or-less the same
as the Gnu C 'extern inline'. */
#if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__)
/* We're using GCC, but without the new C99-compatible behaviour. */
#define _ELIDABLE_INLINE extern __inline__ _ATTRIBUTE ((__always_inline__))
#else
/* We're using GCC in C99 mode, or an unknown compiler which
we just have to hope obeys the C99 semantics of inline. */
#define _ELIDABLE_INLINE static __inline__
#endif

#if __GNUC_PREREQ (3, 1)
#define _NOINLINE __attribute__ ((__noinline__))
#define _NOINLINE_STATIC _NOINLINE static
#else
/* On non-GNU compilers and GCC prior to version 3.1 the compiler can't be
trusted not to inline if it is static. */
#define _NOINLINE
#define _NOINLINE_STATIC
#endif

#endif /* _ANSIDECL_H_ */
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* _newlib_version.h. Generated from _newlib_version.hin by configure. */
/* Version macros for internal and downstream use. */
#ifndef _NEWLIB_VERSION_H__
#define _NEWLIB_VERSION_H__ 1

#define _NEWLIB_VERSION "3.1.0"
#define __NEWLIB__ 3
#define __NEWLIB_MINOR__ 1
#define __NEWLIB_PATCHLEVEL__ 0

#endif /* !_NEWLIB_VERSION_H__ */

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/* internal use only -- mapping of "system calls" for libraries that lose
and only provide C names, so that we end up in violation of ANSI */
#ifndef __SYSLIST_H
#define __SYSLIST_H

#ifdef MISSING_SYSCALL_NAMES
#define _close close
#define _execve execve
#define _fcntl fcntl
#define _fork fork
#define _fstat fstat
#define _getpid getpid
#define _gettimeofday gettimeofday
#define _isatty isatty
#define _kill kill
#define _link link
#define _lseek lseek
#define _mkdir mkdir
#define _open open
#define _read read
#define _sbrk sbrk
#define _stat stat
#define _times times
#define _unlink unlink
#define _wait wait
#define _write write
#endif /* MISSING_SYSCALL_NAMES */

#if defined MISSING_SYSCALL_NAMES || !defined HAVE_OPENDIR
/* If the system call interface is missing opendir, readdir, and
closedir, there is an implementation of these functions in
libc/posix that is implemented using open, getdents, and close.
Note, these functions are currently not in the libc/syscalls
directory. */
#define _opendir opendir
#define _readdir readdir
#define _closedir closedir
#endif /* MISSING_SYSCALL_NAMES || !HAVE_OPENDIR */

#endif /* !__SYSLIST_H_ */
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* libc/include/alloca.h - Allocate memory on stack */

/* Written 2000 by Werner Almesberger */
/* Rearranged for general inclusion by stdlib.h.
2001, Corinna Vinschen <vinschen@redhat.com> */

#ifndef _NEWLIB_ALLOCA_H
#define _NEWLIB_ALLOCA_H

#include "_ansi.h"
#include <sys/reent.h>

#undef alloca

#ifdef __GNUC__
#define alloca(size) __builtin_alloca(size)
#else
void * alloca (size_t);
#endif

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/* $NetBSD: ar.h,v 1.4 1994/10/26 00:55:43 cgd Exp $ */

/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* This code is derived from software contributed to Berkeley by
* Hugh Smith at The University of Guelph.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)ar.h 8.2 (Berkeley) 1/21/94
*/

#ifndef _AR_H_
#define _AR_H_

/* Pre-4BSD archives had these magic numbers in them. */
#define OARMAG1 0177555
#define OARMAG2 0177545

#define ARMAG "!<arch>\n" /* ar "magic number" */
#define SARMAG 8 /* strlen(ARMAG); */

#define AR_EFMT1 "#1/" /* extended format #1 */

struct ar_hdr {
char ar_name[16]; /* name */
char ar_date[12]; /* modification time */
char ar_uid[6]; /* user id */
char ar_gid[6]; /* group id */
char ar_mode[8]; /* octal file permissions */
char ar_size[10]; /* size in bytes */
#define ARFMAG "`\n"
char ar_fmag[2]; /* consistency check */
};

#endif /* !_AR_H_ */
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
*
* Permission to use, copy, modify, and distribute this software
* is freely granted, provided that this notice is preserved.
*/

#ifndef _ARGZ_H_
#define _ARGZ_H_

#include <errno.h>
#include <sys/types.h>

#include "_ansi.h"

_BEGIN_STD_C

/* The newlib implementation of these functions assumes that sizeof(char) == 1. */
error_t argz_create (char *const argv[], char **argz, size_t *argz_len);
error_t argz_create_sep (const char *string, int sep, char **argz, size_t *argz_len);
size_t argz_count (const char *argz, size_t argz_len);
void argz_extract (char *argz, size_t argz_len, char **argv);
void argz_stringify (char *argz, size_t argz_len, int sep);
error_t argz_add (char **argz, size_t *argz_len, const char *str);
error_t argz_add_sep (char **argz, size_t *argz_len, const char *str, int sep);
error_t argz_append (char **argz, size_t *argz_len, const char *buf, size_t buf_len);
error_t argz_delete (char **argz, size_t *argz_len, char *entry);
error_t argz_insert (char **argz, size_t *argz_len, char *before, const char *entry);
char * argz_next (char *argz, size_t argz_len, const char *entry);
error_t argz_replace (char **argz, size_t *argz_len, const char *str, const char *with, unsigned *replace_count);

_END_STD_C

#endif /* _ARGZ_H_ */
Loading