From 8bbfb40e572ddb8a11482ca513131e21a75e99de Mon Sep 17 00:00:00 2001 From: Jerome Brunet Date: Fri, 19 Oct 2018 12:14:57 +0200 Subject: board: amlogic: remove p212 derivatives The Khadas vim and the libretech aml-s905x-cc (aka Potato) derive from amlogic s905x reference design (P212). All the code in these board is a copy/paste from the p212, which is tedious to maintain. This change use p212 u-boot board for all these boards, while keeping a dedicated defconfig to customize the names and device tree. Signed-off-by: Jerome Brunet Signed-off-by: Neil Armstrong --- board/amlogic/khadas-vim/Kconfig | 12 ---- board/amlogic/khadas-vim/MAINTAINERS | 6 -- board/amlogic/khadas-vim/Makefile | 6 -- board/amlogic/khadas-vim/README | 102 ----------------------------- board/amlogic/khadas-vim/khadas-vim.c | 57 ----------------- board/amlogic/libretech-cc/Kconfig | 12 ---- board/amlogic/libretech-cc/MAINTAINERS | 6 -- board/amlogic/libretech-cc/Makefile | 6 -- board/amlogic/libretech-cc/README | 102 ----------------------------- board/amlogic/libretech-cc/libretech-cc.c | 57 ----------------- board/amlogic/p212/README | 103 ------------------------------ board/amlogic/p212/README.khadas-vim | 102 +++++++++++++++++++++++++++++ board/amlogic/p212/README.libretech-cc | 102 +++++++++++++++++++++++++++++ board/amlogic/p212/README.p212 | 103 ++++++++++++++++++++++++++++++ 14 files changed, 307 insertions(+), 469 deletions(-) delete mode 100644 board/amlogic/khadas-vim/Kconfig delete mode 100644 board/amlogic/khadas-vim/MAINTAINERS delete mode 100644 board/amlogic/khadas-vim/Makefile delete mode 100644 board/amlogic/khadas-vim/README delete mode 100644 board/amlogic/khadas-vim/khadas-vim.c delete mode 100644 board/amlogic/libretech-cc/Kconfig delete mode 100644 board/amlogic/libretech-cc/MAINTAINERS delete mode 100644 board/amlogic/libretech-cc/Makefile delete mode 100644 board/amlogic/libretech-cc/README delete mode 100644 board/amlogic/libretech-cc/libretech-cc.c delete mode 100644 board/amlogic/p212/README create mode 100644 board/amlogic/p212/README.khadas-vim create mode 100644 board/amlogic/p212/README.libretech-cc create mode 100644 board/amlogic/p212/README.p212 (limited to 'board') diff --git a/board/amlogic/khadas-vim/Kconfig b/board/amlogic/khadas-vim/Kconfig deleted file mode 100644 index 0fa8db97ea..0000000000 --- a/board/amlogic/khadas-vim/Kconfig +++ /dev/null @@ -1,12 +0,0 @@ -if TARGET_KHADAS_VIM - -config SYS_BOARD - default "khadas-vim" - -config SYS_VENDOR - default "amlogic" - -config SYS_CONFIG_NAME - default "khadas-vim" - -endif diff --git a/board/amlogic/khadas-vim/MAINTAINERS b/board/amlogic/khadas-vim/MAINTAINERS deleted file mode 100644 index 024220a526..0000000000 --- a/board/amlogic/khadas-vim/MAINTAINERS +++ /dev/null @@ -1,6 +0,0 @@ -KHADAS-VIM -M: Neil Armstrong -S: Maintained -F: board/amlogic/khadas-vim/ -F: include/configs/khadas-vim.h -F: configs/khadas-vim_defconfig diff --git a/board/amlogic/khadas-vim/Makefile b/board/amlogic/khadas-vim/Makefile deleted file mode 100644 index 558c0769b7..0000000000 --- a/board/amlogic/khadas-vim/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0+ -# -# (C) Copyright 2016 BayLibre, SAS -# Author: Neil Armstrong - -obj-y := khadas-vim.o diff --git a/board/amlogic/khadas-vim/README b/board/amlogic/khadas-vim/README deleted file mode 100644 index b1942364f8..0000000000 --- a/board/amlogic/khadas-vim/README +++ /dev/null @@ -1,102 +0,0 @@ -U-Boot for Khadas VIM -======================= - -Khadas VIM is an Open Source DIY Box manufactured by Shenzhen Wesion -Technology Co., Ltd with the following specifications: - - - Amlogic S905X ARM Cortex-A53 quad-core SoC @ 1.5GHz - - ARM Mali 450 GPU - - 2GB DDR3 SDRAM - - 10/100 Ethernet - - HDMI 2.0 4K/60Hz display - - 40-pin GPIO header - - 2 x USB 2.0 Host, 1 x USB 2.0 Type-C OTG - - 8GB/16GBeMMC - - microSD - - SDIO Wifi Module, Bluetooth - - Two channels IR receiver - -Currently the u-boot port supports the following devices: - - serial - - eMMC, microSD - - Ethernet - - I2C - - Regulators - - Reset controller - - Clock controller - - USB Host - - ADC - -U-Boot compilation -================== - - > export ARCH=arm - > export CROSS_COMPILE=aarch64-none-elf- - > make khadas-vim_defconfig - > make - -Image creation -============== - -Amlogic doesn't provide sources for the firmware and for tools needed -to create the bootloader image, so it is necessary to obtain them from -the git tree published by the board vendor: - - > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz - > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz - > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz - > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz - > export PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH - > git clone https://github.com/khadas/u-boot -b Vim vim-u-boot - > cd vim-u-boot - > make kvim_defconfig - > make - > export FIPDIR=$PWD/fip - -Go back to mainline U-Boot source tree then : - > mkdir fip - - > cp $FIPDIR/gxl/bl2.bin fip/ - > cp $FIPDIR/gxl/acs.bin fip/ - > cp $FIPDIR/gxl/bl21.bin fip/ - > cp $FIPDIR/gxl/bl30.bin fip/ - > cp $FIPDIR/gxl/bl301.bin fip/ - > cp $FIPDIR/gxl/bl31.img fip/ - > cp u-boot.bin fip/bl33.bin - - > $FIPDIR/blx_fix.sh \ - fip/bl30.bin \ - fip/zero_tmp \ - fip/bl30_zero.bin \ - fip/bl301.bin \ - fip/bl301_zero.bin \ - fip/bl30_new.bin \ - bl30 - - > python $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0 - - > $FIPDIR/blx_fix.sh \ - fip/bl2_acs.bin \ - fip/zero_tmp \ - fip/bl2_zero.bin \ - fip/bl21.bin \ - fip/bl21_zero.bin \ - fip/bl2_new.bin \ - bl2 - - > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin - > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img - > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin - > $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output fip/bl2.n.bin.sig - > $FIPDIR/gxl/aml_encrypt_gxl --bootmk \ - --output fip/u-boot.bin \ - --bl2 fip/bl2.n.bin.sig \ - --bl30 fip/bl30_new.bin.enc \ - --bl31 fip/bl31.img.enc \ - --bl33 fip/bl33.bin.enc - -and then write the image to SD with: - - > DEV=/dev/your_sd_device - > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 - > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 diff --git a/board/amlogic/khadas-vim/khadas-vim.c b/board/amlogic/khadas-vim/khadas-vim.c deleted file mode 100644 index 692bf2add3..0000000000 --- a/board/amlogic/khadas-vim/khadas-vim.c +++ /dev/null @@ -1,57 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * Copyright (C) 2016 BayLibre, SAS - * Author: Neil Armstrong - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#define EFUSE_SN_OFFSET 20 -#define EFUSE_SN_SIZE 16 -#define EFUSE_MAC_OFFSET 52 -#define EFUSE_MAC_SIZE 6 - -int board_init(void) -{ - return 0; -} - -int misc_init_r(void) -{ - u8 mac_addr[EFUSE_MAC_SIZE]; - char serial[EFUSE_SN_SIZE]; - ssize_t len; - - meson_gx_eth_init(PHY_INTERFACE_MODE_RMII, - MESON_GXL_USE_INTERNAL_RMII_PHY); - - if (!eth_env_get_enetaddr("ethaddr", mac_addr)) { - len = meson_sm_read_efuse(EFUSE_MAC_OFFSET, - mac_addr, EFUSE_MAC_SIZE); - if (len == EFUSE_MAC_SIZE && is_valid_ethaddr(mac_addr)) - eth_env_set_enetaddr("ethaddr", mac_addr); - } - - if (!env_get("serial#")) { - len = meson_sm_read_efuse(EFUSE_SN_OFFSET, serial, - EFUSE_SN_SIZE); - if (len == EFUSE_SN_SIZE) - env_set("serial#", serial); - } - - return 0; -} - -int ft_board_setup(void *blob, bd_t *bd) -{ - meson_gx_init_reserved_memory(blob); - - return 0; -} diff --git a/board/amlogic/libretech-cc/Kconfig b/board/amlogic/libretech-cc/Kconfig deleted file mode 100644 index 7a6f9169bd..0000000000 --- a/board/amlogic/libretech-cc/Kconfig +++ /dev/null @@ -1,12 +0,0 @@ -if TARGET_LIBRETECH_CC - -config SYS_BOARD - default "libretech-cc" - -config SYS_VENDOR - default "amlogic" - -config SYS_CONFIG_NAME - default "libretech-cc" - -endif diff --git a/board/amlogic/libretech-cc/MAINTAINERS b/board/amlogic/libretech-cc/MAINTAINERS deleted file mode 100644 index 398ce57db2..0000000000 --- a/board/amlogic/libretech-cc/MAINTAINERS +++ /dev/null @@ -1,6 +0,0 @@ -LIBRETECH-CC -M: Neil Armstrong -S: Maintained -F: board/amlogic/libretech-cc/ -F: include/configs/libretech-cc.h -F: configs/libretech-cc_defconfig diff --git a/board/amlogic/libretech-cc/Makefile b/board/amlogic/libretech-cc/Makefile deleted file mode 100644 index 3b0adf8bf5..0000000000 --- a/board/amlogic/libretech-cc/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0+ -# -# (C) Copyright 2016 BayLibre, SAS -# Author: Neil Armstrong - -obj-y := libretech-cc.o diff --git a/board/amlogic/libretech-cc/README b/board/amlogic/libretech-cc/README deleted file mode 100644 index d007f58764..0000000000 --- a/board/amlogic/libretech-cc/README +++ /dev/null @@ -1,102 +0,0 @@ -U-Boot for LibreTech CC -======================= - -LibreTech CC is a single board computer manufactured by Libre Technology -with the following specifications: - - - Amlogic S905X ARM Cortex-A53 quad-core SoC @ 1.5GHz - - ARM Mali 450 GPU - - 2GB DDR3 SDRAM - - 10/100 Ethernet - - HDMI 2.0 4K/60Hz display - - 40-pin GPIO header - - 4 x USB 2.0 Host - - eMMC, microSD - - Infrared receiver - -Schematics are available on the manufacturer website. - -Currently the U-Boot port supports the following devices: - - serial - - eMMC, microSD - - Ethernet - - I2C - - Regulators - - Reset controller - - Clock controller - - USB Host - - ADC - -U-Boot compilation -================== - - > export ARCH=arm - > export CROSS_COMPILE=aarch64-none-elf- - > make libretech-cc_defconfig - > make - -Image creation -============== - -Amlogic doesn't provide sources for the firmware and for tools needed -to create the bootloader image, so it is necessary to obtain them from -the git tree published by the board vendor: - - > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz - > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz - > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz - > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz - > export PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH - > git clone https://github.com/BayLibre/u-boot.git -b libretech-cc amlogic-u-boot - > cd amlogic-u-boot - > make libretech_cc_defconfig - > make - > export FIPDIR=$PWD/fip - -Go back to mainline U-Boot source tree then : - > mkdir fip - - > cp $FIPDIR/gxl/bl2.bin fip/ - > cp $FIPDIR/gxl/acs.bin fip/ - > cp $FIPDIR/gxl/bl21.bin fip/ - > cp $FIPDIR/gxl/bl30.bin fip/ - > cp $FIPDIR/gxl/bl301.bin fip/ - > cp $FIPDIR/gxl/bl31.img fip/ - > cp u-boot.bin fip/bl33.bin - - > $FIPDIR/blx_fix.sh \ - fip/bl30.bin \ - fip/zero_tmp \ - fip/bl30_zero.bin \ - fip/bl301.bin \ - fip/bl301_zero.bin \ - fip/bl30_new.bin \ - bl30 - - > $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0 - - > $FIPDIR/blx_fix.sh \ - fip/bl2_acs.bin \ - fip/zero_tmp \ - fip/bl2_zero.bin \ - fip/bl21.bin \ - fip/bl21_zero.bin \ - fip/bl2_new.bin \ - bl2 - - > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin - > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img - > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin - > $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output fip/bl2.n.bin.sig - > $FIPDIR/gxl/aml_encrypt_gxl --bootmk \ - --output fip/u-boot.bin \ - --bl2 fip/bl2.n.bin.sig \ - --bl30 fip/bl30_new.bin.enc \ - --bl31 fip/bl31.img.enc \ - --bl33 fip/bl33.bin.enc - -and then write the image to SD with: - - > DEV=/dev/your_sd_device - > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 - > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 diff --git a/board/amlogic/libretech-cc/libretech-cc.c b/board/amlogic/libretech-cc/libretech-cc.c deleted file mode 100644 index ccab1272c5..0000000000 --- a/board/amlogic/libretech-cc/libretech-cc.c +++ /dev/null @@ -1,57 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * Copyright (C) 2016 BayLibre, SAS - * Author: Neil Armstrong - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#define EFUSE_SN_OFFSET 20 -#define EFUSE_SN_SIZE 16 -#define EFUSE_MAC_OFFSET 52 -#define EFUSE_MAC_SIZE 6 - -int board_init(void) -{ - return 0; -} - -int misc_init_r(void) -{ - u8 mac_addr[EFUSE_MAC_SIZE]; - char serial[EFUSE_SN_SIZE]; - ssize_t len; - - meson_gx_eth_init(PHY_INTERFACE_MODE_RMII, - MESON_GXL_USE_INTERNAL_RMII_PHY); - - if (!eth_env_get_enetaddr("ethaddr", mac_addr)) { - len = meson_sm_read_efuse(EFUSE_MAC_OFFSET, - mac_addr, EFUSE_MAC_SIZE); - if (len == EFUSE_MAC_SIZE && is_valid_ethaddr(mac_addr)) - eth_env_set_enetaddr("ethaddr", mac_addr); - } - - if (!env_get("serial#")) { - len = meson_sm_read_efuse(EFUSE_SN_OFFSET, serial, - EFUSE_SN_SIZE); - if (len == EFUSE_SN_SIZE) - env_set("serial#", serial); - } - - return 0; -} - -int ft_board_setup(void *blob, bd_t *bd) -{ - meson_gx_init_reserved_memory(blob); - - return 0; -} diff --git a/board/amlogic/p212/README b/board/amlogic/p212/README deleted file mode 100644 index ef5370c763..0000000000 --- a/board/amlogic/p212/README +++ /dev/null @@ -1,103 +0,0 @@ -U-Boot for Amlogic P212 -======================= - -P212 is a reference board manufactured by Amlogic with the following -specifications: - - - Amlogic S905X ARM Cortex-A53 quad-core SoC @ 1.5GHz - - ARM Mali 450 GPU - - 2GB DDR3 SDRAM - - 10/100 Ethernet - - HDMI 2.0 4K/60Hz display - - 2 x USB 2.0 Host - - eMMC, microSD - - Infrared receiver - - SDIO WiFi Module - - CVBS+Stereo Audio Jack - -Schematics are available from Amlogic on demand. - -Currently the u-boot port supports the following devices: - - serial - - eMMC, microSD - - Ethernet - - I2C - - Regulators - - Reset controller - - Clock controller - - USB Host - - ADC - -u-boot compilation -================== - - > export ARCH=arm - > export CROSS_COMPILE=aarch64-none-elf- - > make p212_defconfig - > make - -Image creation -============== - -Amlogic doesn't provide sources for the firmware and for tools needed -to create the bootloader image, so it is necessary to obtain them from -the git tree published by the board vendor: - - > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz - > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz - > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz - > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz - > export PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH - > git clone https://github.com/BayLibre/u-boot.git -b n-amlogic-openlinux-20170606 amlogic-u-boot - > cd amlogic-u-boot - > make gxl_p212_v1_defconfig - > make - > export FIPDIR=$PWD/fip - -Go back to mainline U-boot source tree then : - > mkdir fip - - > cp $FIPDIR/gxl/bl2.bin fip/ - > cp $FIPDIR/gxl/acs.bin fip/ - > cp $FIPDIR/gxl/bl21.bin fip/ - > cp $FIPDIR/gxl/bl30.bin fip/ - > cp $FIPDIR/gxl/bl301.bin fip/ - > cp $FIPDIR/gxl/bl31.img fip/ - > cp u-boot.bin fip/bl33.bin - - > $FIPDIR/blx_fix.sh \ - fip/bl30.bin \ - fip/zero_tmp \ - fip/bl30_zero.bin \ - fip/bl301.bin \ - fip/bl301_zero.bin \ - fip/bl30_new.bin \ - bl30 - - > $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0 - - > $FIPDIR/blx_fix.sh \ - fip/bl2_acs.bin \ - fip/zero_tmp \ - fip/bl2_zero.bin \ - fip/bl21.bin \ - fip/bl21_zero.bin \ - fip/bl2_new.bin \ - bl2 - - > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin - > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img - > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin - > $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output fip/bl2.n.bin.sig - > $FIPDIR/gxl/aml_encrypt_gxl --bootmk \ - --output fip/u-boot.bin \ - --bl2 fip/bl2.n.bin.sig \ - --bl30 fip/bl30_new.bin.enc \ - --bl31 fip/bl31.img.enc \ - --bl33 fip/bl33.bin.enc - -and then write the image to SD with: - - > DEV=/dev/your_sd_device - > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 - > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 diff --git a/board/amlogic/p212/README.khadas-vim b/board/amlogic/p212/README.khadas-vim new file mode 100644 index 0000000000..b1942364f8 --- /dev/null +++ b/board/amlogic/p212/README.khadas-vim @@ -0,0 +1,102 @@ +U-Boot for Khadas VIM +======================= + +Khadas VIM is an Open Source DIY Box manufactured by Shenzhen Wesion +Technology Co., Ltd with the following specifications: + + - Amlogic S905X ARM Cortex-A53 quad-core SoC @ 1.5GHz + - ARM Mali 450 GPU + - 2GB DDR3 SDRAM + - 10/100 Ethernet + - HDMI 2.0 4K/60Hz display + - 40-pin GPIO header + - 2 x USB 2.0 Host, 1 x USB 2.0 Type-C OTG + - 8GB/16GBeMMC + - microSD + - SDIO Wifi Module, Bluetooth + - Two channels IR receiver + +Currently the u-boot port supports the following devices: + - serial + - eMMC, microSD + - Ethernet + - I2C + - Regulators + - Reset controller + - Clock controller + - USB Host + - ADC + +U-Boot compilation +================== + + > export ARCH=arm + > export CROSS_COMPILE=aarch64-none-elf- + > make khadas-vim_defconfig + > make + +Image creation +============== + +Amlogic doesn't provide sources for the firmware and for tools needed +to create the bootloader image, so it is necessary to obtain them from +the git tree published by the board vendor: + + > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz + > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz + > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz + > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz + > export PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH + > git clone https://github.com/khadas/u-boot -b Vim vim-u-boot + > cd vim-u-boot + > make kvim_defconfig + > make + > export FIPDIR=$PWD/fip + +Go back to mainline U-Boot source tree then : + > mkdir fip + + > cp $FIPDIR/gxl/bl2.bin fip/ + > cp $FIPDIR/gxl/acs.bin fip/ + > cp $FIPDIR/gxl/bl21.bin fip/ + > cp $FIPDIR/gxl/bl30.bin fip/ + > cp $FIPDIR/gxl/bl301.bin fip/ + > cp $FIPDIR/gxl/bl31.img fip/ + > cp u-boot.bin fip/bl33.bin + + > $FIPDIR/blx_fix.sh \ + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 + + > python $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0 + + > $FIPDIR/blx_fix.sh \ + fip/bl2_acs.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/bl21.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 + + > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin + > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img + > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin + > $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output fip/bl2.n.bin.sig + > $FIPDIR/gxl/aml_encrypt_gxl --bootmk \ + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc + +and then write the image to SD with: + + > DEV=/dev/your_sd_device + > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 + > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 diff --git a/board/amlogic/p212/README.libretech-cc b/board/amlogic/p212/README.libretech-cc new file mode 100644 index 0000000000..d007f58764 --- /dev/null +++ b/board/amlogic/p212/README.libretech-cc @@ -0,0 +1,102 @@ +U-Boot for LibreTech CC +======================= + +LibreTech CC is a single board computer manufactured by Libre Technology +with the following specifications: + + - Amlogic S905X ARM Cortex-A53 quad-core SoC @ 1.5GHz + - ARM Mali 450 GPU + - 2GB DDR3 SDRAM + - 10/100 Ethernet + - HDMI 2.0 4K/60Hz display + - 40-pin GPIO header + - 4 x USB 2.0 Host + - eMMC, microSD + - Infrared receiver + +Schematics are available on the manufacturer website. + +Currently the U-Boot port supports the following devices: + - serial + - eMMC, microSD + - Ethernet + - I2C + - Regulators + - Reset controller + - Clock controller + - USB Host + - ADC + +U-Boot compilation +================== + + > export ARCH=arm + > export CROSS_COMPILE=aarch64-none-elf- + > make libretech-cc_defconfig + > make + +Image creation +============== + +Amlogic doesn't provide sources for the firmware and for tools needed +to create the bootloader image, so it is necessary to obtain them from +the git tree published by the board vendor: + + > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz + > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz + > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz + > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz + > export PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH + > git clone https://github.com/BayLibre/u-boot.git -b libretech-cc amlogic-u-boot + > cd amlogic-u-boot + > make libretech_cc_defconfig + > make + > export FIPDIR=$PWD/fip + +Go back to mainline U-Boot source tree then : + > mkdir fip + + > cp $FIPDIR/gxl/bl2.bin fip/ + > cp $FIPDIR/gxl/acs.bin fip/ + > cp $FIPDIR/gxl/bl21.bin fip/ + > cp $FIPDIR/gxl/bl30.bin fip/ + > cp $FIPDIR/gxl/bl301.bin fip/ + > cp $FIPDIR/gxl/bl31.img fip/ + > cp u-boot.bin fip/bl33.bin + + > $FIPDIR/blx_fix.sh \ + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 + + > $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0 + + > $FIPDIR/blx_fix.sh \ + fip/bl2_acs.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/bl21.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 + + > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin + > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img + > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin + > $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output fip/bl2.n.bin.sig + > $FIPDIR/gxl/aml_encrypt_gxl --bootmk \ + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc + +and then write the image to SD with: + + > DEV=/dev/your_sd_device + > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 + > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 diff --git a/board/amlogic/p212/README.p212 b/board/amlogic/p212/README.p212 new file mode 100644 index 0000000000..ef5370c763 --- /dev/null +++ b/board/amlogic/p212/README.p212 @@ -0,0 +1,103 @@ +U-Boot for Amlogic P212 +======================= + +P212 is a reference board manufactured by Amlogic with the following +specifications: + + - Amlogic S905X ARM Cortex-A53 quad-core SoC @ 1.5GHz + - ARM Mali 450 GPU + - 2GB DDR3 SDRAM + - 10/100 Ethernet + - HDMI 2.0 4K/60Hz display + - 2 x USB 2.0 Host + - eMMC, microSD + - Infrared receiver + - SDIO WiFi Module + - CVBS+Stereo Audio Jack + +Schematics are available from Amlogic on demand. + +Currently the u-boot port supports the following devices: + - serial + - eMMC, microSD + - Ethernet + - I2C + - Regulators + - Reset controller + - Clock controller + - USB Host + - ADC + +u-boot compilation +================== + + > export ARCH=arm + > export CROSS_COMPILE=aarch64-none-elf- + > make p212_defconfig + > make + +Image creation +============== + +Amlogic doesn't provide sources for the firmware and for tools needed +to create the bootloader image, so it is necessary to obtain them from +the git tree published by the board vendor: + + > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz + > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz + > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz + > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz + > export PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH + > git clone https://github.com/BayLibre/u-boot.git -b n-amlogic-openlinux-20170606 amlogic-u-boot + > cd amlogic-u-boot + > make gxl_p212_v1_defconfig + > make + > export FIPDIR=$PWD/fip + +Go back to mainline U-boot source tree then : + > mkdir fip + + > cp $FIPDIR/gxl/bl2.bin fip/ + > cp $FIPDIR/gxl/acs.bin fip/ + > cp $FIPDIR/gxl/bl21.bin fip/ + > cp $FIPDIR/gxl/bl30.bin fip/ + > cp $FIPDIR/gxl/bl301.bin fip/ + > cp $FIPDIR/gxl/bl31.img fip/ + > cp u-boot.bin fip/bl33.bin + + > $FIPDIR/blx_fix.sh \ + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 + + > $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0 + + > $FIPDIR/blx_fix.sh \ + fip/bl2_acs.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/bl21.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 + + > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin + > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img + > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin + > $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output fip/bl2.n.bin.sig + > $FIPDIR/gxl/aml_encrypt_gxl --bootmk \ + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc + +and then write the image to SD with: + + > DEV=/dev/your_sd_device + > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 + > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 -- cgit v1.2.3 From 302987b6c56dba7e694b0ac8233e2b0c2aa107e6 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Fri, 9 Nov 2018 11:57:47 +0100 Subject: board: amlogic: move khadas-vim2 as q200 ref board The Khadas vim2 derive from amlogic s912 reference design (Q200). This patch moves the khadas-vim2 board support to a generic Q200 board, while keeping a dedicated defconfig to customize the names and device tree. Signed-off-by: Neil Armstrong --- board/amlogic/khadas-vim2/Kconfig | 12 ---- board/amlogic/khadas-vim2/MAINTAINERS | 6 -- board/amlogic/khadas-vim2/Makefile | 6 -- board/amlogic/khadas-vim2/README | 103 -------------------------------- board/amlogic/khadas-vim2/khadas-vim2.c | 62 ------------------- board/amlogic/q200/Kconfig | 12 ++++ board/amlogic/q200/MAINTAINERS | 6 ++ board/amlogic/q200/Makefile | 6 ++ board/amlogic/q200/README.khadas-vim2 | 103 ++++++++++++++++++++++++++++++++ board/amlogic/q200/README.q200 | 102 +++++++++++++++++++++++++++++++ board/amlogic/q200/q200.c | 62 +++++++++++++++++++ 11 files changed, 291 insertions(+), 189 deletions(-) delete mode 100644 board/amlogic/khadas-vim2/Kconfig delete mode 100644 board/amlogic/khadas-vim2/MAINTAINERS delete mode 100644 board/amlogic/khadas-vim2/Makefile delete mode 100644 board/amlogic/khadas-vim2/README delete mode 100644 board/amlogic/khadas-vim2/khadas-vim2.c create mode 100644 board/amlogic/q200/Kconfig create mode 100644 board/amlogic/q200/MAINTAINERS create mode 100644 board/amlogic/q200/Makefile create mode 100644 board/amlogic/q200/README.khadas-vim2 create mode 100644 board/amlogic/q200/README.q200 create mode 100644 board/amlogic/q200/q200.c (limited to 'board') diff --git a/board/amlogic/khadas-vim2/Kconfig b/board/amlogic/khadas-vim2/Kconfig deleted file mode 100644 index d0af36264d..0000000000 --- a/board/amlogic/khadas-vim2/Kconfig +++ /dev/null @@ -1,12 +0,0 @@ -if TARGET_KHADAS_VIM2 - -config SYS_BOARD - default "khadas-vim2" - -config SYS_VENDOR - default "amlogic" - -config SYS_CONFIG_NAME - default "khadas-vim2" - -endif diff --git a/board/amlogic/khadas-vim2/MAINTAINERS b/board/amlogic/khadas-vim2/MAINTAINERS deleted file mode 100644 index ca63e311c6..0000000000 --- a/board/amlogic/khadas-vim2/MAINTAINERS +++ /dev/null @@ -1,6 +0,0 @@ -KHADAS-VIM2 -M: Neil Armstrong -S: Maintained -F: board/amlogic/khadas-vim2/ -F: include/configs/khadas-vim2.h -F: configs/khadas-vim2_defconfig diff --git a/board/amlogic/khadas-vim2/Makefile b/board/amlogic/khadas-vim2/Makefile deleted file mode 100644 index 4e7c9a0592..0000000000 --- a/board/amlogic/khadas-vim2/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0+ -# -# (C) Copyright 2016 BayLibre, SAS -# Author: Neil Armstrong - -obj-y := khadas-vim2.o diff --git a/board/amlogic/khadas-vim2/README b/board/amlogic/khadas-vim2/README deleted file mode 100644 index 578693fd2d..0000000000 --- a/board/amlogic/khadas-vim2/README +++ /dev/null @@ -1,103 +0,0 @@ -U-Boot for Khadas VIM2 -======================= - -Khadas VIM2 is an Open Source DIY Box manufactured by Shenzhen Wesion -Technology Co., Ltd with the following specifications: - - - Amlogic S912 ARM Cortex-A53 octo-core SoC @ 1.5GHz - - ARM Mali T860 GPU - - 2/3GB DDR4 SDRAM - - 10/100/1000 Ethernet - - HDMI 2.0 4K/60Hz display - - 40-pin GPIO header - - 2 x USB 2.0 Host, 1 x USB 2.0 Type-C OTG - - 16GB/32GB/64GB eMMC - - 2MB SPI Flash - - microSD - - SDIO Wifi Module, Bluetooth - - Two channels IR receiver - -Currently the u-boot port supports the following devices: - - serial - - eMMC, microSD - - Ethernet - - I2C - - Regulators - - Reset controller - - Clock controller - - USB Host - - ADC - -U-Boot compilation -================== - - > export ARCH=arm - > export CROSS_COMPILE=aarch64-none-elf- - > make khadas-vim2_defconfig - > make - -Image creation -============== - -Amlogic doesn't provide sources for the firmware and for tools needed -to create the bootloader image, so it is necessary to obtain them from -the git tree published by the board vendor: - - > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz - > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz - > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz - > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz - > export PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH - > git clone https://github.com/khadas/u-boot -b Vim vim-u-boot - > cd vim-u-boot - > make kvim_defconfig - > make - > export FIPDIR=$PWD/fip - -Go back to mainline U-Boot source tree then : - > mkdir fip - - > cp $FIPDIR/gxl/bl2.bin fip/ - > cp $FIPDIR/gxl/acs.bin fip/ - > cp $FIPDIR/gxl/bl21.bin fip/ - > cp $FIPDIR/gxl/bl30.bin fip/ - > cp $FIPDIR/gxl/bl301.bin fip/ - > cp $FIPDIR/gxl/bl31.img fip/ - > cp u-boot.bin fip/bl33.bin - - > $FIPDIR/blx_fix.sh \ - fip/bl30.bin \ - fip/zero_tmp \ - fip/bl30_zero.bin \ - fip/bl301.bin \ - fip/bl301_zero.bin \ - fip/bl30_new.bin \ - bl30 - - > python $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0 - - > $FIPDIR/blx_fix.sh \ - fip/bl2_acs.bin \ - fip/zero_tmp \ - fip/bl2_zero.bin \ - fip/bl21.bin \ - fip/bl21_zero.bin \ - fip/bl2_new.bin \ - bl2 - - > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin - > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img - > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin - > $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output fip/bl2.n.bin.sig - > $FIPDIR/gxl/aml_encrypt_gxl --bootmk \ - --output fip/u-boot.bin \ - --bl2 fip/bl2.n.bin.sig \ - --bl30 fip/bl30_new.bin.enc \ - --bl31 fip/bl31.img.enc \ - --bl33 fip/bl33.bin.enc - -and then write the image to SD with: - - > DEV=/dev/your_sd_device - > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 - > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 diff --git a/board/amlogic/khadas-vim2/khadas-vim2.c b/board/amlogic/khadas-vim2/khadas-vim2.c deleted file mode 100644 index ff56569f17..0000000000 --- a/board/amlogic/khadas-vim2/khadas-vim2.c +++ /dev/null @@ -1,62 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * Copyright (C) 2016 BayLibre, SAS - * Author: Neil Armstrong - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#define EFUSE_SN_OFFSET 20 -#define EFUSE_SN_SIZE 16 -#define EFUSE_MAC_OFFSET 52 -#define EFUSE_MAC_SIZE 6 - -int board_init(void) -{ - return 0; -} - -int misc_init_r(void) -{ - u8 mac_addr[EFUSE_MAC_SIZE]; - char serial[EFUSE_SN_SIZE]; - ssize_t len; - - meson_gx_eth_init(PHY_INTERFACE_MODE_RGMII, 0); - - /* Reset PHY on GPIOZ_14 */ - clrbits_le32(GX_GPIO_EN(3), BIT(14)); - clrbits_le32(GX_GPIO_OUT(3), BIT(14)); - mdelay(10); - setbits_le32(GX_GPIO_OUT(3), BIT(14)); - - if (!eth_env_get_enetaddr("ethaddr", mac_addr)) { - len = meson_sm_read_efuse(EFUSE_MAC_OFFSET, - mac_addr, EFUSE_MAC_SIZE); - if (len == EFUSE_MAC_SIZE && is_valid_ethaddr(mac_addr)) - eth_env_set_enetaddr("ethaddr", mac_addr); - } - - if (!env_get("serial#")) { - len = meson_sm_read_efuse(EFUSE_SN_OFFSET, serial, - EFUSE_SN_SIZE); - if (len == EFUSE_SN_SIZE) - env_set("serial#", serial); - } - - return 0; -} - -int ft_board_setup(void *blob, bd_t *bd) -{ - meson_gx_init_reserved_memory(blob); - - return 0; -} diff --git a/board/amlogic/q200/Kconfig b/board/amlogic/q200/Kconfig new file mode 100644 index 0000000000..cfaf3797ac --- /dev/null +++ b/board/amlogic/q200/Kconfig @@ -0,0 +1,12 @@ +if TARGET_Q200 + +config SYS_BOARD + default "q200" + +config SYS_VENDOR + default "amlogic" + +config SYS_CONFIG_NAME + default "q200" + +endif diff --git a/board/amlogic/q200/MAINTAINERS b/board/amlogic/q200/MAINTAINERS new file mode 100644 index 0000000000..be86386619 --- /dev/null +++ b/board/amlogic/q200/MAINTAINERS @@ -0,0 +1,6 @@ +Q200 +M: Neil Armstrong +S: Maintained +F: board/amlogic/q200/ +F: include/configs/q200.h +F: configs/khadas-vim2_defconfig diff --git a/board/amlogic/q200/Makefile b/board/amlogic/q200/Makefile new file mode 100644 index 0000000000..fd78fd068a --- /dev/null +++ b/board/amlogic/q200/Makefile @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# (C) Copyright 2016 BayLibre, SAS +# Author: Neil Armstrong + +obj-y := q200.o diff --git a/board/amlogic/q200/README.khadas-vim2 b/board/amlogic/q200/README.khadas-vim2 new file mode 100644 index 0000000000..578693fd2d --- /dev/null +++ b/board/amlogic/q200/README.khadas-vim2 @@ -0,0 +1,103 @@ +U-Boot for Khadas VIM2 +======================= + +Khadas VIM2 is an Open Source DIY Box manufactured by Shenzhen Wesion +Technology Co., Ltd with the following specifications: + + - Amlogic S912 ARM Cortex-A53 octo-core SoC @ 1.5GHz + - ARM Mali T860 GPU + - 2/3GB DDR4 SDRAM + - 10/100/1000 Ethernet + - HDMI 2.0 4K/60Hz display + - 40-pin GPIO header + - 2 x USB 2.0 Host, 1 x USB 2.0 Type-C OTG + - 16GB/32GB/64GB eMMC + - 2MB SPI Flash + - microSD + - SDIO Wifi Module, Bluetooth + - Two channels IR receiver + +Currently the u-boot port supports the following devices: + - serial + - eMMC, microSD + - Ethernet + - I2C + - Regulators + - Reset controller + - Clock controller + - USB Host + - ADC + +U-Boot compilation +================== + + > export ARCH=arm + > export CROSS_COMPILE=aarch64-none-elf- + > make khadas-vim2_defconfig + > make + +Image creation +============== + +Amlogic doesn't provide sources for the firmware and for tools needed +to create the bootloader image, so it is necessary to obtain them from +the git tree published by the board vendor: + + > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz + > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz + > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz + > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz + > export PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH + > git clone https://github.com/khadas/u-boot -b Vim vim-u-boot + > cd vim-u-boot + > make kvim_defconfig + > make + > export FIPDIR=$PWD/fip + +Go back to mainline U-Boot source tree then : + > mkdir fip + + > cp $FIPDIR/gxl/bl2.bin fip/ + > cp $FIPDIR/gxl/acs.bin fip/ + > cp $FIPDIR/gxl/bl21.bin fip/ + > cp $FIPDIR/gxl/bl30.bin fip/ + > cp $FIPDIR/gxl/bl301.bin fip/ + > cp $FIPDIR/gxl/bl31.img fip/ + > cp u-boot.bin fip/bl33.bin + + > $FIPDIR/blx_fix.sh \ + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 + + > python $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0 + + > $FIPDIR/blx_fix.sh \ + fip/bl2_acs.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/bl21.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 + + > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin + > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img + > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin + > $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output fip/bl2.n.bin.sig + > $FIPDIR/gxl/aml_encrypt_gxl --bootmk \ + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc + +and then write the image to SD with: + + > DEV=/dev/your_sd_device + > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 + > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 diff --git a/board/amlogic/q200/README.q200 b/board/amlogic/q200/README.q200 new file mode 100644 index 0000000000..55d730a0d2 --- /dev/null +++ b/board/amlogic/q200/README.q200 @@ -0,0 +1,102 @@ +U-Boot for Amlogic Q200 +======================= + +Q200 is a reference board manufactured by Amlogic with the following +specifications: + + - Amlogic S912 ARM Cortex-A53 octo-core SoC @ 1.5GHz + - ARM Mali T860 GPU + - 2/3GB DDR4 SDRAM + - 10/100/1000 Ethernet + - HDMI 2.0 4K/60Hz display + - 2 x USB 2.0 Host, 1 x USB 2.0 Device + - 16GB/32GB/64GB eMMC + - 2MB SPI Flash + - microSD + - SDIO Wifi Module, Bluetooth + - IR receiver + +Currently the u-boot port supports the following devices: + - serial + - eMMC, microSD + - Ethernet + - I2C + - Regulators + - Reset controller + - Clock controller + - USB Host + - ADC + +U-Boot compilation +================== + + > export ARCH=arm + > export CROSS_COMPILE=aarch64-none-elf- + > make khadas-vim2_defconfig + > make + +Image creation +============== + +Amlogic doesn't provide sources for the firmware and for tools needed +to create the bootloader image, so it is necessary to obtain them from +the git tree published by the board vendor: + + > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz + > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz + > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz + > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz + > export PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH + > git clone https://github.com/BayLibre/u-boot.git -b n-amlogic-openlinux-20170606 amlogic-u-boot + > cd amlogic-u-boot + > make gxm_q200_v1_defconfig + > make + > export FIPDIR=$PWD/fip + +Go back to mainline U-Boot source tree then : + > mkdir fip + + > cp $FIPDIR/gxl/bl2.bin fip/ + > cp $FIPDIR/gxl/acs.bin fip/ + > cp $FIPDIR/gxl/bl21.bin fip/ + > cp $FIPDIR/gxl/bl30.bin fip/ + > cp $FIPDIR/gxl/bl301.bin fip/ + > cp $FIPDIR/gxl/bl31.img fip/ + > cp u-boot.bin fip/bl33.bin + + > $FIPDIR/blx_fix.sh \ + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 + + > python $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0 + + > $FIPDIR/blx_fix.sh \ + fip/bl2_acs.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/bl21.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 + + > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin + > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img + > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin + > $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output fip/bl2.n.bin.sig + > $FIPDIR/gxl/aml_encrypt_gxl --bootmk \ + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc + +and then write the image to SD with: + + > DEV=/dev/your_sd_device + > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 + > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 diff --git a/board/amlogic/q200/q200.c b/board/amlogic/q200/q200.c new file mode 100644 index 0000000000..ff56569f17 --- /dev/null +++ b/board/amlogic/q200/q200.c @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2016 BayLibre, SAS + * Author: Neil Armstrong + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define EFUSE_SN_OFFSET 20 +#define EFUSE_SN_SIZE 16 +#define EFUSE_MAC_OFFSET 52 +#define EFUSE_MAC_SIZE 6 + +int board_init(void) +{ + return 0; +} + +int misc_init_r(void) +{ + u8 mac_addr[EFUSE_MAC_SIZE]; + char serial[EFUSE_SN_SIZE]; + ssize_t len; + + meson_gx_eth_init(PHY_INTERFACE_MODE_RGMII, 0); + + /* Reset PHY on GPIOZ_14 */ + clrbits_le32(GX_GPIO_EN(3), BIT(14)); + clrbits_le32(GX_GPIO_OUT(3), BIT(14)); + mdelay(10); + setbits_le32(GX_GPIO_OUT(3), BIT(14)); + + if (!eth_env_get_enetaddr("ethaddr", mac_addr)) { + len = meson_sm_read_efuse(EFUSE_MAC_OFFSET, + mac_addr, EFUSE_MAC_SIZE); + if (len == EFUSE_MAC_SIZE && is_valid_ethaddr(mac_addr)) + eth_env_set_enetaddr("ethaddr", mac_addr); + } + + if (!env_get("serial#")) { + len = meson_sm_read_efuse(EFUSE_SN_OFFSET, serial, + EFUSE_SN_SIZE); + if (len == EFUSE_SN_SIZE) + env_set("serial#", serial); + } + + return 0; +} + +int ft_board_setup(void *blob, bd_t *bd) +{ + meson_gx_init_reserved_memory(blob); + + return 0; +} -- cgit v1.2.3 From d54e03b612e4e8dcb406b95a8a6a2f8fd7fb055b Mon Sep 17 00:00:00 2001 From: Jerome Brunet Date: Fri, 19 Oct 2018 13:27:40 +0200 Subject: board: amlogic: factorise gxbb boards The nanopi-k2 and the odroid-c2 are similar enough to be supported by the same u-boot board. This change use odroid-c2 u-boot board for the nanopi-k2 as well. Dedicated defconfig are kept to customize the names and device tree. Signed-off-by: Jerome Brunet Signed-off-by: Neil Armstrong --- board/amlogic/nanopi-k2/Kconfig | 12 ---- board/amlogic/nanopi-k2/MAINTAINERS | 6 -- board/amlogic/nanopi-k2/Makefile | 7 --- board/amlogic/nanopi-k2/README | 99 -------------------------------- board/amlogic/nanopi-k2/nanopi-k2.c | 55 ------------------ board/amlogic/odroid-c2/MAINTAINERS | 1 + board/amlogic/odroid-c2/README | 66 --------------------- board/amlogic/odroid-c2/README.nanopi-k2 | 99 ++++++++++++++++++++++++++++++++ board/amlogic/odroid-c2/README.odroid-c2 | 66 +++++++++++++++++++++ 9 files changed, 166 insertions(+), 245 deletions(-) delete mode 100644 board/amlogic/nanopi-k2/Kconfig delete mode 100644 board/amlogic/nanopi-k2/MAINTAINERS delete mode 100644 board/amlogic/nanopi-k2/Makefile delete mode 100644 board/amlogic/nanopi-k2/README delete mode 100644 board/amlogic/nanopi-k2/nanopi-k2.c delete mode 100644 board/amlogic/odroid-c2/README create mode 100644 board/amlogic/odroid-c2/README.nanopi-k2 create mode 100644 board/amlogic/odroid-c2/README.odroid-c2 (limited to 'board') diff --git a/board/amlogic/nanopi-k2/Kconfig b/board/amlogic/nanopi-k2/Kconfig deleted file mode 100644 index 374bda200c..0000000000 --- a/board/amlogic/nanopi-k2/Kconfig +++ /dev/null @@ -1,12 +0,0 @@ -if TARGET_NANOPI_K2 - -config SYS_BOARD - default "nanopi-k2" - -config SYS_VENDOR - default "amlogic" - -config SYS_CONFIG_NAME - default "nanopi-k2" - -endif diff --git a/board/amlogic/nanopi-k2/MAINTAINERS b/board/amlogic/nanopi-k2/MAINTAINERS deleted file mode 100644 index 0452bd1fa1..0000000000 --- a/board/amlogic/nanopi-k2/MAINTAINERS +++ /dev/null @@ -1,6 +0,0 @@ -NANOPI-K2 -M: Neil Armstrong -S: Maintained -F: board/amlogic/nanopi-k2/ -F: include/configs/nanopi-k2.h -F: configs/nanopi-k2_defconfig diff --git a/board/amlogic/nanopi-k2/Makefile b/board/amlogic/nanopi-k2/Makefile deleted file mode 100644 index 7d9b666e76..0000000000 --- a/board/amlogic/nanopi-k2/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# -# (C) Copyright 2018 Thomas McKahan -# -# SPDX-License-Identifier: GPL-2.0+ -# - -obj-y := nanopi-k2.o diff --git a/board/amlogic/nanopi-k2/README b/board/amlogic/nanopi-k2/README deleted file mode 100644 index d450d3c2b2..0000000000 --- a/board/amlogic/nanopi-k2/README +++ /dev/null @@ -1,99 +0,0 @@ -U-Boot for NanoPi-K2 -==================== - -NanoPi-K2 is a single board computer manufactured by FriendlyElec -with the following specifications: - - - Amlogic S905 ARM Cortex-A53 quad-core SoC @ 1.5GHz - - ARM Mali 450 GPU - - 2GB DDR3 SDRAM - - Gigabit Ethernet - - HDMI 2.0 4K/60Hz display - - 40-pin GPIO header - - 4 x USB 2.0 Host, 1 x USB OTG - - eMMC, microSD - - Infrared receiver - -Schematics are available on the manufacturer website. - -Currently the u-boot port supports the following devices: - - serial - - eMMC, microSD - - Ethernet - -u-boot compilation -================== - - > export ARCH=arm - > export CROSS_COMPILE=aarch64-none-elf- - > make nanopi-k2_defconfig - > make - -Image creation -============== - -Amlogic doesn't provide sources for the firmware and for tools needed -to create the bootloader image, so it is necessary to obtain them from -the git tree published by the board vendor: - - > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz - > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz - > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz - > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz - > export PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH - > git clone https://github.com/BayLibre/u-boot.git -b libretech-cc amlogic-u-boot - > git clone https://github.com/friendlyarm/u-boot.git -b nanopi-k2-v2015.01 amlogic-u-boot - > cd amlogic-u-boot - > sed -i 's/aarch64-linux-gnu-/aarch64-none-elf-/' Makefile - > sed -i 's/arm-linux-/arm-none-eabi-/' arch/arm/cpu/armv8/gxb/firmware/scp_task/Makefile - > make nanopi-k2_defconfig - > make - > export FIPDIR=$PWD/fip - -Go back to mainline U-Boot source tree then : - > mkdir fip - - > cp $FIPDIR/gxb/bl2.bin fip/ - > cp $FIPDIR/gxb/acs.bin fip/ - > cp $FIPDIR/gxb/bl21.bin fip/ - > cp $FIPDIR/gxb/bl30.bin fip/ - > cp $FIPDIR/gxb/bl301.bin fip/ - > cp $FIPDIR/gxb/bl31.img fip/ - > cp u-boot.bin fip/bl33.bin - - > $FIPDIR/blx_fix.sh \ - fip/bl30.bin \ - fip/zero_tmp \ - fip/bl30_zero.bin \ - fip/bl301.bin \ - fip/bl301_zero.bin \ - fip/bl30_new.bin \ - bl30 - - > $FIPDIR/fip_create \ - --bl30 fip/bl30_new.bin \ - --bl31 fip/bl31.img \ - --bl33 fip/bl33.bin \ - fip/fip.bin - - > python $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0 - - > $FIPDIR/blx_fix.sh \ - fip/bl2_acs.bin \ - fip/zero_tmp \ - fip/bl2_zero.bin \ - fip/bl21.bin \ - fip/bl21_zero.bin \ - fip/bl2_new.bin \ - bl2 - - > cat fip/bl2_new.bin fip/fip.bin > fip/boot_new.bin - - > $FIPDIR/gxb/aml_encrypt_gxb --bootsig \ - --input fip/boot_new.bin - --output fip/u-boot.bin - -and then write the image to SD with: - - > DEV=/dev/your_sd_device - > dd if=fip/u-boot.bin of=$DEV conv=fsync,notrunc bs=512 seek=1 diff --git a/board/amlogic/nanopi-k2/nanopi-k2.c b/board/amlogic/nanopi-k2/nanopi-k2.c deleted file mode 100644 index ae29dd6fa4..0000000000 --- a/board/amlogic/nanopi-k2/nanopi-k2.c +++ /dev/null @@ -1,55 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * (C) Copyright 2018 Thomas McKahan - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#define EFUSE_SN_OFFSET 20 -#define EFUSE_SN_SIZE 16 -#define EFUSE_MAC_OFFSET 52 -#define EFUSE_MAC_SIZE 6 - -int board_init(void) -{ - return 0; -} - -int misc_init_r(void) -{ - u8 mac_addr[EFUSE_MAC_SIZE]; - char serial[EFUSE_SN_SIZE]; - ssize_t len; - - meson_gx_eth_init(PHY_INTERFACE_MODE_RGMII, 0); - - if (!eth_env_get_enetaddr("ethaddr", mac_addr)) { - len = meson_sm_read_efuse(EFUSE_MAC_OFFSET, - mac_addr, EFUSE_MAC_SIZE); - if (len == EFUSE_MAC_SIZE && is_valid_ethaddr(mac_addr)) - eth_env_set_enetaddr("ethaddr", mac_addr); - } - - if (!env_get("serial#")) { - len = meson_sm_read_efuse(EFUSE_SN_OFFSET, serial, - EFUSE_SN_SIZE); - if (len == EFUSE_SN_SIZE) - env_set("serial#", serial); - } - - return 0; -} - -int ft_board_setup(void *blob, bd_t *bd) -{ - meson_gx_init_reserved_memory(blob); - - return 0; -} diff --git a/board/amlogic/odroid-c2/MAINTAINERS b/board/amlogic/odroid-c2/MAINTAINERS index 699850fd0c..fd74d53bfe 100644 --- a/board/amlogic/odroid-c2/MAINTAINERS +++ b/board/amlogic/odroid-c2/MAINTAINERS @@ -1,5 +1,6 @@ ODROID-C2 M: Beniamino Galvani +M: Neil Armstrong S: Maintained F: board/amlogic/odroid-c2/ F: include/configs/odroid-c2.h diff --git a/board/amlogic/odroid-c2/README b/board/amlogic/odroid-c2/README deleted file mode 100644 index bed48c5728..0000000000 --- a/board/amlogic/odroid-c2/README +++ /dev/null @@ -1,66 +0,0 @@ -U-Boot for ODROID-C2 -==================== - -ODROID-C2 is a single board computer manufactured by Hardkernel -Co. Ltd with the following specifications: - - - Amlogic S905 ARM Cortex-A53 quad-core SoC @ 2GHz - - ARM Mali 450 GPU - - 2GB DDR3 SDRAM - - Gigabit Ethernet - - HDMI 2.0 4K/60Hz display - - 40-pin GPIO header - - 4 x USB 2.0 Host, 1 x USB OTG - - eMMC, microSD - - Infrared receiver - -Schematics are available on the manufacturer website. - -Currently the u-boot port supports the following devices: - - serial - - eMMC, microSD - - Ethernet - - I2C - - Regulators - - Reset controller - - Clock controller - - ADC - -u-boot compilation -================== - - > export ARCH=arm - > export CROSS_COMPILE=aarch64-none-elf- - > make odroid-c2_defconfig - > make - -Image creation -============== - -Amlogic doesn't provide sources for the firmware and for tools needed -to create the bootloader image, so it is necessary to obtain them from -the git tree published by the board vendor: - - > DIR=odroid-c2 - > git clone --depth 1 \ - https://github.com/hardkernel/u-boot.git -b odroidc2-v2015.01 \ - $DIR - > $DIR/fip/fip_create --bl30 $DIR/fip/gxb/bl30.bin \ - --bl301 $DIR/fip/gxb/bl301.bin \ - --bl31 $DIR/fip/gxb/bl31.bin \ - --bl33 u-boot.bin \ - $DIR/fip.bin - > $DIR/fip/fip_create --dump $DIR/fip.bin - > cat $DIR/fip/gxb/bl2.package $DIR/fip.bin > $DIR/boot_new.bin - > $DIR/fip/gxb/aml_encrypt_gxb --bootsig \ - --input $DIR/boot_new.bin \ - --output $DIR/u-boot.img - > dd if=$DIR/u-boot.img of=$DIR/u-boot.gxbb bs=512 skip=96 - -and then write the image to SD with: - - > DEV=/dev/your_sd_device - > BL1=$DIR/sd_fuse/bl1.bin.hardkernel - > dd if=$BL1 of=$DEV conv=fsync bs=1 count=442 - > dd if=$BL1 of=$DEV conv=fsync bs=512 skip=1 seek=1 - > dd if=$DIR/u-boot.gxbb of=$DEV conv=fsync bs=512 seek=97 diff --git a/board/amlogic/odroid-c2/README.nanopi-k2 b/board/amlogic/odroid-c2/README.nanopi-k2 new file mode 100644 index 0000000000..d450d3c2b2 --- /dev/null +++ b/board/amlogic/odroid-c2/README.nanopi-k2 @@ -0,0 +1,99 @@ +U-Boot for NanoPi-K2 +==================== + +NanoPi-K2 is a single board computer manufactured by FriendlyElec +with the following specifications: + + - Amlogic S905 ARM Cortex-A53 quad-core SoC @ 1.5GHz + - ARM Mali 450 GPU + - 2GB DDR3 SDRAM + - Gigabit Ethernet + - HDMI 2.0 4K/60Hz display + - 40-pin GPIO header + - 4 x USB 2.0 Host, 1 x USB OTG + - eMMC, microSD + - Infrared receiver + +Schematics are available on the manufacturer website. + +Currently the u-boot port supports the following devices: + - serial + - eMMC, microSD + - Ethernet + +u-boot compilation +================== + + > export ARCH=arm + > export CROSS_COMPILE=aarch64-none-elf- + > make nanopi-k2_defconfig + > make + +Image creation +============== + +Amlogic doesn't provide sources for the firmware and for tools needed +to create the bootloader image, so it is necessary to obtain them from +the git tree published by the board vendor: + + > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz + > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz + > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz + > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz + > export PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH + > git clone https://github.com/BayLibre/u-boot.git -b libretech-cc amlogic-u-boot + > git clone https://github.com/friendlyarm/u-boot.git -b nanopi-k2-v2015.01 amlogic-u-boot + > cd amlogic-u-boot + > sed -i 's/aarch64-linux-gnu-/aarch64-none-elf-/' Makefile + > sed -i 's/arm-linux-/arm-none-eabi-/' arch/arm/cpu/armv8/gxb/firmware/scp_task/Makefile + > make nanopi-k2_defconfig + > make + > export FIPDIR=$PWD/fip + +Go back to mainline U-Boot source tree then : + > mkdir fip + + > cp $FIPDIR/gxb/bl2.bin fip/ + > cp $FIPDIR/gxb/acs.bin fip/ + > cp $FIPDIR/gxb/bl21.bin fip/ + > cp $FIPDIR/gxb/bl30.bin fip/ + > cp $FIPDIR/gxb/bl301.bin fip/ + > cp $FIPDIR/gxb/bl31.img fip/ + > cp u-boot.bin fip/bl33.bin + + > $FIPDIR/blx_fix.sh \ + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 + + > $FIPDIR/fip_create \ + --bl30 fip/bl30_new.bin \ + --bl31 fip/bl31.img \ + --bl33 fip/bl33.bin \ + fip/fip.bin + + > python $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0 + + > $FIPDIR/blx_fix.sh \ + fip/bl2_acs.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/bl21.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 + + > cat fip/bl2_new.bin fip/fip.bin > fip/boot_new.bin + + > $FIPDIR/gxb/aml_encrypt_gxb --bootsig \ + --input fip/boot_new.bin + --output fip/u-boot.bin + +and then write the image to SD with: + + > DEV=/dev/your_sd_device + > dd if=fip/u-boot.bin of=$DEV conv=fsync,notrunc bs=512 seek=1 diff --git a/board/amlogic/odroid-c2/README.odroid-c2 b/board/amlogic/odroid-c2/README.odroid-c2 new file mode 100644 index 0000000000..bed48c5728 --- /dev/null +++ b/board/amlogic/odroid-c2/README.odroid-c2 @@ -0,0 +1,66 @@ +U-Boot for ODROID-C2 +==================== + +ODROID-C2 is a single board computer manufactured by Hardkernel +Co. Ltd with the following specifications: + + - Amlogic S905 ARM Cortex-A53 quad-core SoC @ 2GHz + - ARM Mali 450 GPU + - 2GB DDR3 SDRAM + - Gigabit Ethernet + - HDMI 2.0 4K/60Hz display + - 40-pin GPIO header + - 4 x USB 2.0 Host, 1 x USB OTG + - eMMC, microSD + - Infrared receiver + +Schematics are available on the manufacturer website. + +Currently the u-boot port supports the following devices: + - serial + - eMMC, microSD + - Ethernet + - I2C + - Regulators + - Reset controller + - Clock controller + - ADC + +u-boot compilation +================== + + > export ARCH=arm + > export CROSS_COMPILE=aarch64-none-elf- + > make odroid-c2_defconfig + > make + +Image creation +============== + +Amlogic doesn't provide sources for the firmware and for tools needed +to create the bootloader image, so it is necessary to obtain them from +the git tree published by the board vendor: + + > DIR=odroid-c2 + > git clone --depth 1 \ + https://github.com/hardkernel/u-boot.git -b odroidc2-v2015.01 \ + $DIR + > $DIR/fip/fip_create --bl30 $DIR/fip/gxb/bl30.bin \ + --bl301 $DIR/fip/gxb/bl301.bin \ + --bl31 $DIR/fip/gxb/bl31.bin \ + --bl33 u-boot.bin \ + $DIR/fip.bin + > $DIR/fip/fip_create --dump $DIR/fip.bin + > cat $DIR/fip/gxb/bl2.package $DIR/fip.bin > $DIR/boot_new.bin + > $DIR/fip/gxb/aml_encrypt_gxb --bootsig \ + --input $DIR/boot_new.bin \ + --output $DIR/u-boot.img + > dd if=$DIR/u-boot.img of=$DIR/u-boot.gxbb bs=512 skip=96 + +and then write the image to SD with: + + > DEV=/dev/your_sd_device + > BL1=$DIR/sd_fuse/bl1.bin.hardkernel + > dd if=$BL1 of=$DEV conv=fsync bs=1 count=442 + > dd if=$BL1 of=$DEV conv=fsync bs=512 skip=1 seek=1 + > dd if=$DIR/u-boot.gxbb of=$DEV conv=fsync bs=512 seek=97 -- cgit v1.2.3 From 96a739b4608dfa6e575b17290d25d7b7c525d517 Mon Sep 17 00:00:00 2001 From: Jerome Brunet Date: Thu, 25 Oct 2018 16:41:37 +0200 Subject: ARM: rework amlogic configuration Rework the board SYS_BOARD, SYS_VENDOR and SYS_CONFIG_NAME setup by moving the board Kconfig into the mach-meson Kconfig to make it easier to add new boards for a SoC architecture and add a custom config header or custom board handler for a platform. This drops the board CONFIGs and the duplicate boards configs headers in favor of a single meson64.h config header. Signed-off-by: Jerome Brunet Signed-off-by: Neil Armstrong --- board/amlogic/odroid-c2/Kconfig | 12 ------------ board/amlogic/p212/Kconfig | 12 ------------ board/amlogic/q200/Kconfig | 12 ------------ 3 files changed, 36 deletions(-) delete mode 100644 board/amlogic/odroid-c2/Kconfig delete mode 100644 board/amlogic/p212/Kconfig delete mode 100644 board/amlogic/q200/Kconfig (limited to 'board') diff --git a/board/amlogic/odroid-c2/Kconfig b/board/amlogic/odroid-c2/Kconfig deleted file mode 100644 index 2b16889b07..0000000000 --- a/board/amlogic/odroid-c2/Kconfig +++ /dev/null @@ -1,12 +0,0 @@ -if TARGET_ODROID_C2 - -config SYS_BOARD - default "odroid-c2" - -config SYS_VENDOR - default "amlogic" - -config SYS_CONFIG_NAME - default "odroid-c2" - -endif diff --git a/board/amlogic/p212/Kconfig b/board/amlogic/p212/Kconfig deleted file mode 100644 index 720c92b1ee..0000000000 --- a/board/amlogic/p212/Kconfig +++ /dev/null @@ -1,12 +0,0 @@ -if TARGET_P212 - -config SYS_BOARD - default "p212" - -config SYS_VENDOR - default "amlogic" - -config SYS_CONFIG_NAME - default "p212" - -endif diff --git a/board/amlogic/q200/Kconfig b/board/amlogic/q200/Kconfig deleted file mode 100644 index cfaf3797ac..0000000000 --- a/board/amlogic/q200/Kconfig +++ /dev/null @@ -1,12 +0,0 @@ -if TARGET_Q200 - -config SYS_BOARD - default "q200" - -config SYS_VENDOR - default "amlogic" - -config SYS_CONFIG_NAME - default "q200" - -endif -- cgit v1.2.3 From 33e3378091391c90a110d93f4c89044b4461fb99 Mon Sep 17 00:00:00 2001 From: Jerome Brunet Date: Fri, 5 Oct 2018 17:00:37 +0200 Subject: ARM: meson: rework soc arch file to prepare for new SoC We are about to add support for the Amlogic AXG SoC. While very close to the Gx SoC family, we will need to handle a few thing which are different in this SoC. Rework the meson arch directory to prepare for this. Signed-off-by: Jerome Brunet Signed-off-by: Neil Armstrong --- board/amlogic/odroid-c2/odroid-c2.c | 6 +++--- board/amlogic/p212/p212.c | 6 +++--- board/amlogic/q200/q200.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'board') diff --git a/board/amlogic/odroid-c2/odroid-c2.c b/board/amlogic/odroid-c2/odroid-c2.c index 2a2755c387..d784d6bd09 100644 --- a/board/amlogic/odroid-c2/odroid-c2.c +++ b/board/amlogic/odroid-c2/odroid-c2.c @@ -28,7 +28,7 @@ int misc_init_r(void) char serial[EFUSE_SN_SIZE]; ssize_t len; - meson_gx_eth_init(PHY_INTERFACE_MODE_RGMII, 0); + meson_eth_init(PHY_INTERFACE_MODE_RGMII, 0); if (!eth_env_get_enetaddr("ethaddr", mac_addr)) { len = meson_sm_read_efuse(EFUSE_MAC_OFFSET, @@ -40,7 +40,7 @@ int misc_init_r(void) if (!env_get("serial#")) { len = meson_sm_read_efuse(EFUSE_SN_OFFSET, serial, EFUSE_SN_SIZE); - if (len == EFUSE_SN_SIZE) + if (len == EFUSE_SN_SIZE) env_set("serial#", serial); } @@ -49,7 +49,7 @@ int misc_init_r(void) int ft_board_setup(void *blob, bd_t *bd) { - meson_gx_init_reserved_memory(blob); + meson_init_reserved_memory(blob); return 0; } diff --git a/board/amlogic/p212/p212.c b/board/amlogic/p212/p212.c index 00e07d77ad..33992a2279 100644 --- a/board/amlogic/p212/p212.c +++ b/board/amlogic/p212/p212.c @@ -29,8 +29,8 @@ int misc_init_r(void) char serial[EFUSE_SN_SIZE]; ssize_t len; - meson_gx_eth_init(PHY_INTERFACE_MODE_RMII, - MESON_GXL_USE_INTERNAL_RMII_PHY); + meson_eth_init(PHY_INTERFACE_MODE_RMII, + MESON_USE_INTERNAL_RMII_PHY); if (!eth_env_get_enetaddr("ethaddr", mac_addr)) { len = meson_sm_read_efuse(EFUSE_MAC_OFFSET, @@ -51,7 +51,7 @@ int misc_init_r(void) int ft_board_setup(void *blob, bd_t *bd) { - meson_gx_init_reserved_memory(blob); + meson_init_reserved_memory(blob); return 0; } diff --git a/board/amlogic/q200/q200.c b/board/amlogic/q200/q200.c index ff56569f17..b59c11bd35 100644 --- a/board/amlogic/q200/q200.c +++ b/board/amlogic/q200/q200.c @@ -29,7 +29,7 @@ int misc_init_r(void) char serial[EFUSE_SN_SIZE]; ssize_t len; - meson_gx_eth_init(PHY_INTERFACE_MODE_RGMII, 0); + meson_eth_init(PHY_INTERFACE_MODE_RGMII, 0); /* Reset PHY on GPIOZ_14 */ clrbits_le32(GX_GPIO_EN(3), BIT(14)); @@ -56,7 +56,7 @@ int misc_init_r(void) int ft_board_setup(void *blob, bd_t *bd) { - meson_gx_init_reserved_memory(blob); + meson_init_reserved_memory(blob); return 0; } -- cgit v1.2.3 From b72794e37e056f3ec18a6cadfe0376058a5c2f34 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Wed, 5 Sep 2018 15:57:11 +0200 Subject: board: amlogic: add support for S400 board The S400 board is the Amlogic AXG SoC reference board including : - Amlogic A113DX ARM Cortex-A53 quad-core SoC @ 1.2GHz - 1GB DDR4 SDRAM - 10/100 Ethernet - 2 x USB 2.0 Host - eMMC - Infrared receiver - SDIO WiFi Module - MIPI DSI Connector - Audio HAT Connector - PCI-E M.2 Connectors Signed-off-by: Jerome Brunet Signed-off-by: Neil Armstrong --- board/amlogic/s400/MAINTAINERS | 6 +++ board/amlogic/s400/Makefile | 6 +++ board/amlogic/s400/README | 110 +++++++++++++++++++++++++++++++++++++++++ board/amlogic/s400/s400.c | 33 +++++++++++++ 4 files changed, 155 insertions(+) create mode 100644 board/amlogic/s400/MAINTAINERS create mode 100644 board/amlogic/s400/Makefile create mode 100644 board/amlogic/s400/README create mode 100644 board/amlogic/s400/s400.c (limited to 'board') diff --git a/board/amlogic/s400/MAINTAINERS b/board/amlogic/s400/MAINTAINERS new file mode 100644 index 0000000000..9ca9836016 --- /dev/null +++ b/board/amlogic/s400/MAINTAINERS @@ -0,0 +1,6 @@ +S400 +M: Neil Armstrong +S: Maintained +F: board/amlogic/s400/ +F: include/configs/s400.h +F: configs/s400_defconfig diff --git a/board/amlogic/s400/Makefile b/board/amlogic/s400/Makefile new file mode 100644 index 0000000000..bf03862b90 --- /dev/null +++ b/board/amlogic/s400/Makefile @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# (C) Copyright 2016 BayLibre, SAS +# Author: Neil Armstrong + +obj-y := s400.o diff --git a/board/amlogic/s400/README b/board/amlogic/s400/README new file mode 100644 index 0000000000..ab21998dc8 --- /dev/null +++ b/board/amlogic/s400/README @@ -0,0 +1,110 @@ +U-Boot for Amlogic S400 +======================= + +S400 is a reference board manufactured by Amlogic with the following +specifications: + + - Amlogic A113DX ARM Cortex-A53 quad-core SoC @ 1.2GHz + - 1GB DDR4 SDRAM + - 10/100 Ethernet + - 2 x USB 2.0 Host + - eMMC + - Infrared receiver + - SDIO WiFi Module + - MIPI DSI Connector + - Audio HAT Connector + - PCI-E M.2 Connectors + +Schematics are available from Amlogic on demand. + +Currently the u-boot port supports the following devices: + - serial + - eMMC + - Ethernet + - I2C + - Regulators + - Reset controller + - Clock controller + - USB Host + - ADC + +u-boot compilation +================== + + > export ARCH=arm + > export CROSS_COMPILE=aarch64-none-elf- + > make s400_defconfig + > make + +Image creation +============== + +Amlogic doesn't provide sources for the firmware and for tools needed +to create the bootloader image, so it is necessary to obtain them from +the git tree published by the board vendor: + + > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz + > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz + > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz + > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz + > export PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH + > git clone https://github.com/BayLibre/u-boot.git -b n-amlogic-openlinux-20170606 amlogic-u-boot + > cd amlogic-u-boot + > make axg_s400_v1_defconfig + > make + > export FIPDIR=$PWD/fip + +Go back to mainline U-boot source tree then : + > mkdir fip + + > cp $FIPDIR/axg/bl2.bin fip/ + > cp $FIPDIR/axg/acs.bin fip/ + > cp $FIPDIR/axg/bl21.bin fip/ + > cp $FIPDIR/axg/bl30.bin fip/ + > cp $FIPDIR/axg/bl301.bin fip/ + > cp $FIPDIR/axg/bl31.img fip/ + > cp u-boot.bin fip/bl33.bin + + > $FIPDIR/blx_fix.sh \ + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 + + > $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0 + + > $FIPDIR/blx_fix.sh \ + fip/bl2_acs.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/bl21.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 + + > $FIPDIR/axg/aml_encrypt_axg --bl3sig --input fip/bl30_new.bin \ + --output fip/bl30_new.bin.enc \ + --level v3 --type bl30 + > $FIPDIR/axg/aml_encrypt_axg --bl3sig --input fip/bl31.img \ + --output fip/bl31.img.enc \ + --level v3 --type bl31 + > $FIPDIR/axg/aml_encrypt_axg --bl3sig --input fip/bl33.bin --compress lz4 \ + --output fip/bl33.bin.enc \ + --level v3 --type bl33 + > $FIPDIR/axg/aml_encrypt_axg --bl2sig --input fip/bl2_new.bin \ + --output fip/bl2.n.bin.sig + > $FIPDIR/axg/aml_encrypt_axg --bootmk \ + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc --level v3 + +and then write the image to SD with: + + > DEV=/dev/your_sd_device + > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 + > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 diff --git a/board/amlogic/s400/s400.c b/board/amlogic/s400/s400.c new file mode 100644 index 0000000000..c2b50f6c17 --- /dev/null +++ b/board/amlogic/s400/s400.c @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2016 BayLibre, SAS + * Author: Neil Armstrong + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +int board_init(void) +{ + return 0; +} + +int misc_init_r(void) +{ + meson_eth_init(PHY_INTERFACE_MODE_RGMII, 0); + + return 0; +} + +int ft_board_setup(void *blob, bd_t *bd) +{ + meson_init_reserved_memory(blob); + + return 0; +} -- cgit v1.2.3 From b890acc7432e2ca7b21a44cc70a87aca51b0aedd Mon Sep 17 00:00:00 2001 From: Jerome Brunet Date: Wed, 24 Oct 2018 14:57:54 +0200 Subject: ARM: meson: factorize common code out amlogic's boards Now we have moved all the Amlogic board support to common generic board code, we can move the identical board_init() and ft_board_setup() functions to weak functions into the board-common mach-meson file. Signed-off-by: Jerome Brunet Signed-off-by: Neil Armstrong --- board/amlogic/odroid-c2/odroid-c2.c | 12 ------------ board/amlogic/p212/p212.c | 12 ------------ board/amlogic/q200/q200.c | 12 ------------ board/amlogic/s400/s400.c | 12 ------------ 4 files changed, 48 deletions(-) (limited to 'board') diff --git a/board/amlogic/odroid-c2/odroid-c2.c b/board/amlogic/odroid-c2/odroid-c2.c index d784d6bd09..62f0f4c871 100644 --- a/board/amlogic/odroid-c2/odroid-c2.c +++ b/board/amlogic/odroid-c2/odroid-c2.c @@ -17,11 +17,6 @@ #define EFUSE_MAC_OFFSET 52 #define EFUSE_MAC_SIZE 6 -int board_init(void) -{ - return 0; -} - int misc_init_r(void) { u8 mac_addr[EFUSE_MAC_SIZE]; @@ -46,10 +41,3 @@ int misc_init_r(void) return 0; } - -int ft_board_setup(void *blob, bd_t *bd) -{ - meson_init_reserved_memory(blob); - - return 0; -} diff --git a/board/amlogic/p212/p212.c b/board/amlogic/p212/p212.c index 33992a2279..546c4d9c86 100644 --- a/board/amlogic/p212/p212.c +++ b/board/amlogic/p212/p212.c @@ -18,11 +18,6 @@ #define EFUSE_MAC_OFFSET 52 #define EFUSE_MAC_SIZE 6 -int board_init(void) -{ - return 0; -} - int misc_init_r(void) { u8 mac_addr[EFUSE_MAC_SIZE]; @@ -48,10 +43,3 @@ int misc_init_r(void) return 0; } - -int ft_board_setup(void *blob, bd_t *bd) -{ - meson_init_reserved_memory(blob); - - return 0; -} diff --git a/board/amlogic/q200/q200.c b/board/amlogic/q200/q200.c index b59c11bd35..6db1b26e08 100644 --- a/board/amlogic/q200/q200.c +++ b/board/amlogic/q200/q200.c @@ -18,11 +18,6 @@ #define EFUSE_MAC_OFFSET 52 #define EFUSE_MAC_SIZE 6 -int board_init(void) -{ - return 0; -} - int misc_init_r(void) { u8 mac_addr[EFUSE_MAC_SIZE]; @@ -53,10 +48,3 @@ int misc_init_r(void) return 0; } - -int ft_board_setup(void *blob, bd_t *bd) -{ - meson_init_reserved_memory(blob); - - return 0; -} diff --git a/board/amlogic/s400/s400.c b/board/amlogic/s400/s400.c index c2b50f6c17..02a0e9286c 100644 --- a/board/amlogic/s400/s400.c +++ b/board/amlogic/s400/s400.c @@ -13,21 +13,9 @@ #include #include -int board_init(void) -{ - return 0; -} - int misc_init_r(void) { meson_eth_init(PHY_INTERFACE_MODE_RGMII, 0); return 0; } - -int ft_board_setup(void *blob, bd_t *bd) -{ - meson_init_reserved_memory(blob); - - return 0; -} -- cgit v1.2.3