Skip to content

Commit

Permalink
Added support for A133
Browse files Browse the repository at this point in the history
* Added support for A133 platform (TrimUI Smart Pro)
* Added powerver ge8300 gpu driver
* Fixed compilation issues with flycast, flycastvl, melonds, gpsp, paralleln64, yabasanshiro, etc. for H700/A133 compatibility
  • Loading branch information
acmeplus committed Apr 28, 2024
1 parent 107bd3e commit 2ad1595
Show file tree
Hide file tree
Showing 132 changed files with 11,841 additions and 22 deletions.
1 change: 1 addition & 0 deletions Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ menu "System"
source "$BR2_EXTERNAL_BATOCERA_PATH/package/batocera/gpu/libmali/Config.in"
source "$BR2_EXTERNAL_BATOCERA_PATH/package/batocera/gpu/img-gpu-powervr/Config.in"
source "$BR2_EXTERNAL_BATOCERA_PATH/package/batocera/gpu/powervr-sgx544-driver/Config.in"
source "$BR2_EXTERNAL_BATOCERA_PATH/package/batocera/gpu/powervr-ge8300-driver/Config.in"
source "$BR2_EXTERNAL_BATOCERA_PATH/package/batocera/gpu/img-mesa3d/Config.in"
source "$BR2_EXTERNAL_BATOCERA_PATH/package/batocera/gpu/mesa-panfork/Config.in"
source "$BR2_EXTERNAL_BATOCERA_PATH/package/batocera/gpu/mali-G610/Config.in"
Expand Down
3 changes: 3 additions & 0 deletions board/batocera/allwinner/a133/fsoverlay/etc/modules.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
snd_seq
sprdbt_tty
sprdwl_ng
8 changes: 8 additions & 0 deletions board/batocera/allwinner/a133/fsoverlay/usr/bin/cputemp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2009-2014 Stephan Raue ([email protected])
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)

TEMP="$(cat /sys/class/thermal/thermal_zone0/temp)"
echo "$(( $TEMP / 1000 )) C"
12 changes: 12 additions & 0 deletions board/batocera/allwinner/a133/fsoverlay/usr/bin/gputemp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2009-2014 Stephan Raue ([email protected])
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)

if [ -f /sys/class/thermal/thermal_zone1/temp ]; then
TEMP="$(cat /sys/class/thermal/thermal_zone1/temp)"
else
TEMP="$(cat /sys/class/thermal/thermal_zone0/temp)"
fi
echo "$(( $TEMP / 1000 )) C"
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff -urN batocera-emulationstation-df059dfe611e36dc0009c03ccef888d22adbf2b2/es-core/src/utils/Platform.cpp old_es/es-core/src/utils/Platform.cpp
--- batocera-emulationstation-df059dfe611e36dc0009c03ccef888d22adbf2b2/es-core/src/utils/Platform.cpp 2024-02-07 23:35:12.786035592 +0000
+++ old_es/es-core/src/utils/Platform.cpp 2024-02-07 23:37:15.749772341 +0000
@@ -171,7 +171,7 @@
#ifdef WIN32 // windows
return system("shutdown -s -t 0");
#else // osx / linux
- return system("shutdown -h now");
+ return system("poweroff.sh);
#endif
}

@@ -180,7 +180,7 @@
#ifdef WIN32 // windows
return system("shutdown -r -t 0");
#else // osx / linux
- return system("shutdown -r now");
+ return system("reboot.sh");
#endif
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
--- a/gfx/drivers_context/sdl_gl_ctx.c 2023-05-04 16:44:44.298271739 +0000
+++ b/gfx/drivers_context/sdl_gl_ctx.c 2023-05-04 16:46:36.009986927 +0000
@@ -149,6 +149,14 @@
#ifdef HAVE_SDL2
unsigned profile;

+ // Workaround
+ if (major == 0)
+ {
+ major = 2;
+ minor = 0;
+ api = GFX_CTX_OPENGL_ES_API;
+ }
+
if (api != GFX_CTX_OPENGL_API && api != GFX_CTX_OPENGL_ES_API)
return false;

43 changes: 43 additions & 0 deletions board/batocera/allwinner/a133/trimui-smart-pro/batocera-boot.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## Lines prefixed by double hashes (##) are comments.
## Lines prefixed by a single hash (#) are commented settings; remove the single hash to activate the setting.

## The device used to store the share data a.k.a. userdata.
## INTERNAL -> Use the same drive Batocera has been flashed to. See https://wiki.batocera.org/add_games_bios on how to add files to the internal storage.
## ANYEXTERNAL -> Use the first external storage detected. See https://wiki.batocera.org/store_games_on_a_second_usb_sata_drive
## Putting the name here of the drive instead will use that specific external storage. Use the menu in Batocera to see the available options.
## DEVICES -> Use external storage for individual folders. See https://wiki.batocera.org/store_games_on_a_second_usb_sata_drive#manual_configuration_with_batocera-bootconf_advanced
## DEV -> Manually define the GUID of the storage device requested. See https://wiki.batocera.org/store_games_on_a_second_usb_sata_drive#dev_mode
## NETWORK -> Use the network share, requires configuration first. See https://wiki.batocera.org/store_games_on_a_nas
sharedevice=INTERNAL

## Add a wait time (in case the share device takes a while to come "online") in seconds.
#sharewait=15

## Automatically resize the userdata partition if unallocated space is present on the drive. Disables itself once completed successfully.
autoresize=true

## Manually override Nvidia driver selected. Leave this setting commented to have Batocera automatically select the correct driver.
## See https://wiki.batocera.org/supported_pc_hardware
## true -> Use the current production driver.
## legacy -> Use the "legacy" 470 driver (could be subject to change, though unlikely).
## legacy390 -> Use the older 390 driver.
## false -> Use the open-source Nouveau drivers.
#nvidia-driver=true

## Enable the Nvidia prime switcher. Helps with modern laptops (post-2018) with hybrid graphics that default to using integrated graphics.
#nvidia-prime=true

## Enable Radeon prime switcher. Helps with modern laptops with amd hybrid graphics that default to using integrated graphics
#radeon-prime=true

## Disable the splash screen.
#splash.screen.enabled=0

## Maximum or specific machine resolution (get the full list for your display with "batocera-resolution listModes")
## See https://wiki.batocera.org/display_issues#force_any_specific_supported_resolution_in_es_instead_of_the_default_maximum_one
#es.resolution=max-1920x1080

### Below are copied values from batocera.conf to make them available in an early boot stage. ###
### Change them in batocera.conf or the menu, not here. ###
wifi.enabled=1
system.timezone=Europe/Paris
219 changes: 219 additions & 0 deletions board/batocera/allwinner/a133/trimui-smart-pro/boot/asound.state
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
state.audiocodec {
control.1 {
iface MIXER
name 'codec hub mode'
value hub_enable
comment {
access 'read write'
type ENUMERATED
count 1
item.0 hub_disable
item.1 hub_enable
}
}
control.2 {
iface MIXER
name 'DAC Swap'
value On
comment {
access 'read write'
type ENUMERATED
count 1
item.0 Off
item.1 On
}
}
control.3 {
iface MIXER
name 'ADC Swap'
value Off
comment {
access 'read write'
type ENUMERATED
count 1
item.0 Off
item.1 On
}
}
control.4 {
iface MIXER
name 'digital volume'
value 0
comment {
access 'read write'
type INTEGER
count 1
range '0 - 63'
dbmin -7424
dbmax -116
dbvalue.0 -7424
}
}
control.5 {
iface MIXER
name 'MIC1 gain volume'
value 31
comment {
access 'read write'
type INTEGER
count 1
range '0 - 31'
dbmin 0
dbmax 3100
dbvalue.0 3100
}
}
control.6 {
iface MIXER
name 'MIC2 gain volume'
value 31
comment {
access 'read write'
type INTEGER
count 1
range '0 - 31'
dbmin 0
dbmax 3100
dbvalue.0 3100
}
}
control.7 {
iface MIXER
name 'LINEOUT volume'
value 26
comment {
access 'read write'
type INTEGER
count 1
range '0 - 31'
dbmin -9999999
dbmax 0
dbvalue.0 -750
}
}
control.8 {
iface MIXER
name 'DAC volume'
value.0 0
value.1 0
comment {
access 'read write'
type INTEGER
count 2
range '0 - 255'
dbmin -11925
dbmax 7200
dbvalue.0 -11925
dbvalue.1 -11925
}
}
control.9 {
iface MIXER
name 'ADC volume'
value.0 160
value.1 160
comment {
access 'read write'
type INTEGER
count 2
range '0 - 255'
dbmin -11925
dbmax 7200
dbvalue.0 75
dbvalue.1 75
}
}
control.10 {
iface MIXER
name 'Headphone Volume'
value 2
comment {
access 'read write'
type INTEGER
count 1
range '0 - 7'
dbmin -4200
dbmax 0
dbvalue.0 -3000
}
}
control.11 {
iface MIXER
name 'LINEOUT Output Select'
value DAC_SINGLE
comment {
access 'read write'
type ENUMERATED
count 1
item.0 DAC_SINGLE
item.1 DAC_DIFFER
}
}
control.12 {
iface MIXER
name 'ADCL Input MIC1 Boost Switch'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.13 {
iface MIXER
name 'ADCR Input MIC2 Boost Switch'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.14 {
iface MIXER
name 'Headphone Switch'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.15 {
iface MIXER
name 'HpSpeaker Switch'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.16 {
iface MIXER
name 'LINEOUT Switch'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.17 {
iface MIXER
name 'Soft Volume Master'
value.0 190
value.1 190
comment {
access 'read write user'
type INTEGER
count 2
range '0 - 255'
tlv '0000000100000008ffffec1400000014'
dbmin -5100
dbmax 0
dbvalue.0 -1300
dbvalue.1 -1300
}
}
}
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.
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.
13 changes: 13 additions & 0 deletions board/batocera/allwinner/a133/trimui-smart-pro/boot/boot.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#
# To prepare u-boot script, run:
# mkimage -A arm64 -T script -O linux -d boot.cmd boot.scr
#

setenv bootargs initrd=/boot/initrd.lz4 label=BATOCERA rootwait earlycon loglevel=9 console=ttyS0,115200 console=tty3

load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /boot/linux
load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /boot/sun50i-h616-x96-mate.dtb
fdt addr ${fdt_addr_r}
fdt resize
load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} /boot/initrd.lz4
booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
LABEL batocera.linux
LINUX /boot/linux
FDT /boot/sun50i-h616-x96-mate.dtb
APPEND initrd=/boot/initrd.lz4 label=BATOCERA rootwait quiet loglevel=0 console=ttyS0,115200 console=tty3
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a1sp9maKde37ee6c-6dc4-4d74-86f0-db32116efb53e0e40ccf-7a66-406b-88c3-415b4a62a8f7777622ab-6bd0-464f-9da5-4cc203e855ea8ce5671f-e8b5-442e-9300-2ee6836c538aabf5f481-c961-4895-8245-631f74851d0c2bbb4229-55a8-4929-a165-3f406f0ee441ab5d09a9-c4dc-44bb-a175-cfb7c978a062329ea51e-1ddc-44ff-ac09-9ef7b64e0c52a712e47d-13f7-4490-9fea-bdcd587b8a4a5ed4d4e6-0ba3-45c5-a778-3232a42d4d960a9b7466-d7b3-4087-b8ff-c51763b852a50cd78bb6-a6d5-43a8-8661-fb91abd346433e8a86ee-711e-49c1-ad54-b59dd01fe513e22b0d8b-647f-4417-a115-9806c5d64eec
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

# HOST_DIR = host dir
# BOARD_DIR = board specific dir
# BUILD_DIR = base dir/build
# BINARIES_DIR = images dir
# TARGET_DIR = target dir
# BATOCERA_BINARIES_DIR = batocera binaries sub directory

HOST_DIR=$1
BOARD_DIR=$2
BUILD_DIR=$3
BINARIES_DIR=$4
TARGET_DIR=$5
BATOCERA_BINARIES_DIR=$6

mkdir -p "${BATOCERA_BINARIES_DIR}/boot/boot" || exit 1

cp "${BOARD_DIR}/uImage" "${BATOCERA_BINARIES_DIR}/boot/uImage" || exit 1
cp "${BOARD_DIR}/uInitrd" "${BATOCERA_BINARIES_DIR}/boot/uInitrd" || exit 1
cp "${BINARIES_DIR}/rootfs.squashfs" "${BATOCERA_BINARIES_DIR}/boot/boot/batocera.update" || exit 1
cp "${BOARD_DIR}/batocera-boot.conf" "${BATOCERA_BINARIES_DIR}/boot/batocera-boot.conf" || exit 1
cp "${BOARD_DIR}/bootlogo.bmp" "${BATOCERA_BINARIES_DIR}/boot/bootlogo.bmp" || exit 1
cp "${BOARD_DIR}/boot/asound.state" "${BATOCERA_BINARIES_DIR}/boot/asound.state" || exit 1

touch "${BATOCERA_BINARIES_DIR}/boot/boot/autoresize"

exit 0
Loading

0 comments on commit 2ad1595

Please sign in to comment.