Skip to content

Commit

Permalink
Identifying Anyka chips and adding an additional toolchain for this p…
Browse files Browse the repository at this point in the history
…latform
  • Loading branch information
wberube committed Aug 30, 2024
1 parent ff21d88 commit e5d61f5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
16 changes: 13 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
#!/bin/sh
DL="https://github.com/openipc/firmware/releases/download/latest"
EXT="tgz"
PRE="linux"

toolchain() {
if [ ! -e toolchain/$1 ]; then
wget -c -q $DL/$1.$EXT -P $PWD
mkdir -p toolchain/$1
tar -xf $1.$EXT -C toolchain/$1 --strip-components=1 || exit 1
if [ "$EXT" = "zip" ]; then
unzip $1.$EXT || exit 1
else
tar -xf $1.$EXT -C toolchain/$1 --strip-components=1 || exit 1
fi
rm -f $1.$EXT
fi
make -j $(nproc) -C src -B CC=$PWD/toolchain/$1/bin/$2-linux-gcc OPT="$OPT $3"
make -j $(nproc) -C src -B CC=$PWD/toolchain/$1/bin/$2-$PRE-gcc OPT="$OPT $3"
}

if [ "$2" = "debug" ]; then
Expand All @@ -19,7 +24,12 @@ else
fi

if [ "$1" = "arm-musl" ]; then
toolchain cortex_a7_thumb2-gcc13-musl-4_9 arm
toolchain cortex_a7_thumb2-gcc13-musl-4_9 arm
elif [ "$1" = "arm9-glibc" ]; then
DL="https://github.com/Lamobo/Lamobo-D1/raw/master/compiler"
EXT="tar.bz2"
PRE="none-linux-gnueabi"
toolchain arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu arm "-ldl -lm -lpthread -lrt -std=gnu99"
elif [ "$1" = "arm9-musl3" ]; then
toolchain arm926t-gcc13-musl-3_0 arm
elif [ "$1" = "arm9-musl4" ]; then
Expand Down
1 change: 1 addition & 0 deletions src/compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ int sTaT(const char *path, struct _stat_ *buf)
#endif

void __assert(void) {}
void akuio_clean_invalidate_dcache(void) {}
void backtrace(void) {}
void backtrace_symbols(void) {}
void __ctype_b(void) {}
Expand Down
13 changes: 10 additions & 3 deletions src/hal/support.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,17 @@ void hal_identify(void) {
return;
}

if (!access("/sys/devices/platform/ak39-uart.0", F_OK)) {
if (!access("/sys/devices/platform/ak39-uart.0", F_OK) &&
hal_registry(0x08000000, &val, OP_READ)) {
plat = HAL_PLATFORM_AK;
strcpy(chip, "AK3918");
strcpy(family, "anyka");
strcpy(chip, "AK3918E");
switch(val) {
case 0x20120100: strcat(chip, "V100"); break;
case 0x20150200: strcat(chip, "V200"); break;
case 0x20160100: strcat(chip, "V300"); break;
case 0x20160101: strcat(chip, "V330"); break;
}
strcpy(family, "AK3918");
chnCount = AK_VENC_CHN_NUM;
chnState = (hal_chnstate*)ak_state;
//aud_thread = ak_audio_thread;
Expand Down

0 comments on commit e5d61f5

Please sign in to comment.