Advertisement
Guest User

orangepicm4.csc

a guest
Nov 6th, 2023
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.24 KB | None | 0 0
  1. # Rockchip RK3566 quad core 4/8GB RAM SoC WIFI/BT eMMC USB2 USB3 NVMe PCIe GbE HDMI SPI
  2. BOARD_NAME="orangepicm4"
  3. BOARDFAMILY="rk35xx"
  4. BOARD_MAINTAINER=""
  5. BOOTCONFIG="orangepi-cm4-rk3566_defconfig"
  6. BOOT_SOC="rk3566"
  7. KERNEL_TARGET="legacy,edge"
  8. FULL_DESKTOP="yes"
  9. BOOT_LOGO="desktop"
  10. BOOT_FDT_FILE="rockchip/rk3566-orangepi-cm4.dtb"
  11. IMAGE_PARTITION_TABLE="gpt"
  12. BOOT_SCENARIO="spl-blobs"
  13. BOOT_SUPPORT_SPI="yes"
  14. BOOT_SPI_RKSPI_LOADER="yes"
  15. MODULES="sprdbt_tty sprdwl_ng"
  16. MODULES_BLACKLIST_LEGACY="bcmdhd"
  17.  
  18. # Newer blobs. Tested to work with opi3b
  19. DDR_BLOB="rk35/rk3566_ddr_1056MHz_v1.18.bin"
  20. BL31_BLOB="rk35/rk3568_bl31_v1.43.elf" # NOT a typo, bl31 is shared across 68 and 66
  21. ROCKUSB_BLOB="rk35/rk3566_spl_loader_1.14.bin" # For `EXT=rkdevflash` flashing
  22.  
  23. # Override family config for this board; let's avoid conditionals in family config.
  24. function post_family_config__orangepicm4_use_vendor_uboot() {
  25.  
  26. BOOTSOURCE="https://github.com/orangepi-xunlong/u-boot-orangepi"
  27. BOOTBRANCH="commit:70b6871381c83615e4a953c80c32f2eb1182102e" # from "branch:v2017.09-rk3588"
  28. BOOTDIR="u-boot" # do not share u-boot directory
  29. BOOTPATCHDIR="v2023.10-orangepi3b" # empty, patches are already in Kwiboo's branch:rk3568-2023.10
  30.  
  31. BOOTDELAY=1 # Wait for UART interrupt to enter UMS/RockUSB mode etc
  32. UBOOT_TARGET_MAP="BL31=${RKBIN_DIR}/${BL31_BLOB} ROCKCHIP_TPL=${RKBIN_DIR}/${DDR_BLOB};;u-boot.bin u-boot.itb idbloader.img"
  33. unset uboot_custom_postprocess write_uboot_platform write_uboot_platform_mtd # disable stuff from rockchip64_common; we're using binman here which does all the work already
  34.  
  35. # Just use the binman-provided u-boot-rockchip.bin, which is ready-to-go
  36. function write_uboot_platform() {
  37. dd if=${1}/u-boot.bin of=${2} bs=32k seek=1 conv=fsync
  38. }
  39.  
  40. # # Smarter/faster/better to-spi writer using flashcp (hopefully with --partition), using the binman-provided 'u-boot-rockchip-spi.bin'
  41. # function write_uboot_platform_mtd() {
  42. # declare -a extra_opts_flashcp=("--verbose")
  43. # if flashcp -h | grep -q -e '--partition'; then
  44. # echo "Confirmed flashcp supports --partition -- read and write only changed blocks." >&2
  45. # extra_opts_flashcp+=("--partition")
  46. # else
  47. # echo "flashcp does not support --partition, will write full SPI flash blocks." >&2
  48. # fi
  49. # flashcp "${extra_opts_flashcp[@]}" "${1}/u-boot-rockchip-spi.bin" /dev/mtd0
  50. # }
  51. #
  52. }
  53.  
  54. function add_host_dependencies__new_uboot_wants_python3_orangepicm4() {
  55. declare -g EXTRA_BUILD_DEPS="${EXTRA_BUILD_DEPS} python3-pyelftools" # @TODO: convert to array later
  56. }
  57.  
  58. function post_family_tweaks_bsp__orangepicm4() {
  59. display_alert "$BOARD" "Installing sprd-bluetooth.service" "info"
  60.  
  61. # Bluetooth on orangepi3b board is handled by a Spreadtrum (sprd) chip and requires
  62. # a custom hciattach_opi binary, plus a systemd service to run it at boot time
  63. install -m 755 $SRC/packages/bsp/rk3399/hciattach_opi $destination/usr/bin
  64. cp $SRC/packages/bsp/rk3399/sprd-bluetooth.service $destination/lib/systemd/system/
  65.  
  66. return 0
  67. }
  68.  
  69. function post_family_tweaks__orangepicm4_enable_services() {
  70. display_alert "$BOARD" "Enabling sprd-bluetooth.service" "info"
  71. chroot_sdcard systemctl enable sprd-bluetooth.service
  72. return 0
  73. }
  74.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement