diff options
Diffstat (limited to 'board')
-rw-r--r-- | board/sunxi/MAINTAINERS | 10 | ||||
-rw-r--r-- | board/sunxi/board.c | 7 | ||||
-rwxr-xr-x | board/sunxi/mksunxi_fit_atf.sh | 10 | ||||
-rw-r--r-- | board/synopsys/axs10x/config.mk | 23 | ||||
-rw-r--r-- | board/synopsys/axs10x/headerize-axs.py | 176 | ||||
-rw-r--r-- | board/synopsys/hsdk/README | 10 | ||||
-rw-r--r-- | board/synopsys/hsdk/config.mk | 2 | ||||
-rw-r--r-- | board/ti/am335x/board.c | 6 | ||||
-rw-r--r-- | board/ti/am335x/board.h | 8 | ||||
-rw-r--r-- | board/ti/am335x/mux.c | 7 |
10 files changed, 251 insertions, 8 deletions
diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS index db51f48ab6..2f95976445 100644 --- a/board/sunxi/MAINTAINERS +++ b/board/sunxi/MAINTAINERS @@ -330,6 +330,11 @@ S: Maintained F: configs/A20-Olimex-SOM204-EVB_defconfig F: configs/A20-Olimex-SOM204-EVB-eMMC_defconfig +ORANGEPI ONE PLUS BOARD +M: Jagan Teki <jagan@amarulasolutions.com> +S: Maintained +F: configs/orangepi_one_plus_defconfig + ORANGEPI WIN/WIN PLUS BOARD M: Jagan Teki <jagan@amarulasolutions.com> S: Maintained @@ -370,6 +375,11 @@ M: Andre Przywara <andre.przywara@arm.com> S: Maintained F: configs/pine64_plus_defconfig +PINE H64 BOARD +M: Icenowy Zheng <icenowy@aosc.io> +S: Maintained +F: configs/pine_h64_defconfig + R16 EVB PARROT BOARD M: Quentin Schulz <quentin.schulz@free-electrons.com> S: Maintained diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 5ed1b8bae1..857d5ff010 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -443,6 +443,13 @@ static void mmc_pinmux_setup(int sdc) sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP); sunxi_gpio_set_drv(pin, 2); } +#elif defined(CONFIG_MACH_SUN50I_H6) + /* SDC2: PC4-PC14 */ + for (pin = SUNXI_GPC(4); pin <= SUNXI_GPC(14); pin++) { + sunxi_gpio_set_cfgpin(pin, SUNXI_GPC_SDC2); + sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP); + sunxi_gpio_set_drv(pin, 2); + } #elif defined(CONFIG_MACH_SUN9I) /* SDC2: PC6-PC16 */ for (pin = SUNXI_GPC(6); pin <= SUNXI_GPC(16); pin++) { diff --git a/board/sunxi/mksunxi_fit_atf.sh b/board/sunxi/mksunxi_fit_atf.sh index 36abe9efed..88ad719747 100755 --- a/board/sunxi/mksunxi_fit_atf.sh +++ b/board/sunxi/mksunxi_fit_atf.sh @@ -13,6 +13,12 @@ if [ ! -f $BL31 ]; then BL31=/dev/null fi +if grep -q "^CONFIG_MACH_SUN50I_H6=y" .config; then + BL31_ADDR=0x104000 +else + BL31_ADDR=0x44000 +fi + cat << __HEADER_EOF /dts-v1/; @@ -35,8 +41,8 @@ cat << __HEADER_EOF type = "firmware"; arch = "arm64"; compression = "none"; - load = <0x44000>; - entry = <0x44000>; + load = <$BL31_ADDR>; + entry = <$BL31_ADDR>; }; __HEADER_EOF diff --git a/board/synopsys/axs10x/config.mk b/board/synopsys/axs10x/config.mk new file mode 100644 index 0000000000..81ff498f81 --- /dev/null +++ b/board/synopsys/axs10x/config.mk @@ -0,0 +1,23 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (C) 2018 Synopsys, Inc. All rights reserved. + +bsp-generate: u-boot u-boot.bin +ifdef CONFIG_ISA_ARCV2 + $(Q)python3 $(srctree)/board/$(BOARDDIR)/headerize-axs.py \ + --header-type v2 \ + --arc-id 0x53 \ + --spi-flash-offset 0x200000 \ + --image $(srctree)/u-boot.bin \ + --elf $(srctree)/u-boot +else + $(Q)python3 $(srctree)/board/$(BOARDDIR)/headerize-axs.py \ + --header-type v1 \ + --arc-id 0x434 \ + --spi-flash-offset 0x0 \ + --image $(srctree)/u-boot.bin \ + --elf $(srctree)/u-boot +endif + $(Q)tools/mkimage -T script -C none -n 'uboot update script' \ + -d $(srctree)/u-boot-update.txt \ + $(srctree)/u-boot-update.img &> /dev/null diff --git a/board/synopsys/axs10x/headerize-axs.py b/board/synopsys/axs10x/headerize-axs.py new file mode 100644 index 0000000000..fa6aaf350c --- /dev/null +++ b/board/synopsys/axs10x/headerize-axs.py @@ -0,0 +1,176 @@ +#!/usr/bin/env python3 + +#we can use binascii instead of zlib +import os, getopt, sys, zlib +from elftools.elf.elffile import ELFFile + + +def usage(exit_code): + print("typical usage:") + print("AXS101:") + print(sys.argv[0] + \ + " --header-type v1 --arc-id 0x434 --spi-flash-offset 0x0 --image u-boot.bin --elf u-boot") + print("AXS103:") + print(sys.argv[0] + \ + " --header-type v2 --arc-id 0x53 --spi-flash-offset 0x200000 --image u-boot.bin --elf u-boot") + sys.exit(exit_code) + + +def elf_get_entry(filename): + with open(filename, 'rb') as f: + elffile = ELFFile(f) + return elffile.header['e_entry'] + + +def calc_check_sum(filename): + # Calculate u-boot image check_sum: it is sum of all u-boot binary bytes + with open(filename, "rb") as file: + ba = bytearray(file.read()) + return sum(ba) & 0xFF + + +def arg_verify(uboot_bin_filename, uboot_elf_filename, header_type): + if not os.path.isfile(uboot_bin_filename): + print("uboot bin file not exists: " + uboot_bin_filename) + sys.exit(2) + + if not os.path.isfile(uboot_elf_filename): + print("uboot elf file not exists: " + uboot_elf_filename) + sys.exit(2) + + if header_type not in ("v1", "v2"): + print("unknown header type: " + header_type) + print("choose between 'v1' (most likely AXS101) and 'v2' (most likely AXS103)") + sys.exit(2) + + +def main(): + try: + opts, args = getopt.getopt(sys.argv[1:], + "ht:a:s:i:l:e:", + ["help", "header-type=", "arc-id=", "spi-flash-offset=", "image=", "elf="]) + except getopt.GetoptError as err: + print(err) + usage(2) + + # default filenames + uboot_elf_filename = "u-boot" + uboot_bin_filename = "u-boot.bin" + headerised_filename = "u-boot.head" + uboot_scrypt_file = "u-boot-update.txt" + + # default values + spi_flash_offset = 0x200000 + header_type = "v2" + arc_id = 0x53 + + # initial header values: place where preloader will store u-boot binary, + # should be equal to CONFIG_SYS_TEXT_BASE + image_copy_adr = 0x81000000 + + # initial constant header values, do not change these values + magic1 = 0xdeadbeafaf # big endian byte order + magic2 = [ # big endian byte order + 0x20202a2020202020202020202a20202020207c5c2e20202020202e2f7c20202020207c2d, + 0x2e5c2020202f2e2d7c20202020205c2020602d2d2d6020202f20202020202f205f202020, + 0x205f20205c20202020207c205f60712070205f207c2020202020272e5f3d2f205c3d5f2e, + 0x272020202020202020605c202f60202020202020202020202020206f2020202020202020] + + for opt, arg in opts: + if opt in ('-h', "--help"): usage(0) + if opt in ('-t', "--header-type"): header_type = arg + if opt in ('-a', "--arc-id"): arc_id = int(arg, 16) + if opt in ('-s', "--spi-flash-offset"): spi_flash_offset = int(arg, 16) + if opt in ('-i', "--image"): uboot_bin_filename = arg + if opt in ('-e', "--elf"): uboot_elf_filename = arg + + arg_verify(uboot_bin_filename, uboot_elf_filename, header_type) + + uboot_img_size = os.path.getsize(uboot_bin_filename) + jump_address = elf_get_entry(uboot_elf_filename) + check_sum = calc_check_sum(uboot_bin_filename) + + # Calculate header adresses depend on header type + if header_type == "v2": + image_copy_adr -= 0x4 + uboot_img_size += 0x4 + # we append image so we need to append checksum + jmpchk_sum = sum(jump_address.to_bytes(4, byteorder='big')) + check_sum = (check_sum + jmpchk_sum) & 0xFF + imade_jump_append = True + else: + imade_jump_append = False + + # write header to file + with open(headerised_filename, "wb") as file: + file.write(arc_id.to_bytes(2, byteorder='little')) + file.write(uboot_img_size.to_bytes(4, byteorder='little')) + file.write(check_sum.to_bytes(1, byteorder='little')) + file.write(image_copy_adr.to_bytes(4, byteorder='little')) + file.write(magic1.to_bytes(5, byteorder='big')) + for i in range(16): file.write(0x00.to_bytes(1, byteorder='little')) + for byte in magic2: file.write(byte.to_bytes(36, byteorder='big')) + for i in range(224 - len(magic2) * 36): + file.write(0x00.to_bytes(1, byteorder='little')) + if imade_jump_append: + file.write(jump_address.to_bytes(4, byteorder='little')) + + # append u-boot image to header + with open(headerised_filename, "ab") as fo: + with open(uboot_bin_filename,'rb') as fi: + fo.write(fi.read()) + + # calc u-boot headerised image CRC32 (will be used by uboot update + # command for check) + headerised_image_crc = "" + with open(headerised_filename, "rb") as fi: + headerised_image_crc = hex(zlib.crc32(fi.read()) & 0xffffffff) + + load_addr = 0x81000000 + crc_store_adr = load_addr - 0x8 + crc_calc_adr = crc_store_adr - 0x4 + load_size = os.path.getsize(headerised_filename) + crc_calc_cmd = \ + "crc32 " + hex(load_addr) + " " + hex(load_size) + " " + hex(crc_calc_adr) + crc_check_cmd = \ + "mw.l " + hex(crc_store_adr) + " " + headerised_image_crc + " && " + \ + crc_calc_cmd + " && " + \ + "cmp.l " + hex(crc_store_adr) + " " + hex(crc_calc_adr) + " 1" + + # make errase size to be allighned by 64K + if load_size & 0xFFFF == 0: + errase_size = load_size + else: + errase_size = load_size - (load_size & 0xFFFF) + 0x10000 + + # Hack to handle n25*** flash protect ops weirdness: + # protect unlock return fail status is region is already unlock (entire or + # partially). Same for lock ops. + # As there is no possibility to check current flash status pretend + # unlock & lock always success. + sf_unlock_cmd = \ + "if sf protect unlock 0x0 0x4000000 ; then true ; else true ; fi" + sf_lock_cmd = \ + "if sf protect lock 0x0 0x4000000 ; then true ; else true ; fi" + + # u-bood CMD to load u-bood with header to SPI flash + sf_load_image_cmd = \ + "fatload mmc 0:1 " + hex(load_addr) + " " + headerised_filename + " && " + \ + "sf probe 0:0 && " + \ + sf_unlock_cmd + " && " + \ + "sf erase " + hex(spi_flash_offset) + " " + hex(errase_size) + " && " + \ + "sf write " + hex(load_addr) + " " + hex(spi_flash_offset) + " " + hex(load_size) + " && " + \ + sf_lock_cmd + + update_uboot_cmd = sf_load_image_cmd + " && echo \"u-boot update: OK\"" + + with open(uboot_scrypt_file, "wb") as fo: + fo.write(update_uboot_cmd.encode('ascii')) + + +if __name__ == "__main__": + try: + main() + except Exception as err: + print(err) + sys.exit(2) diff --git a/board/synopsys/hsdk/README b/board/synopsys/hsdk/README index e3793e4829..e29a6a1727 100644 --- a/board/synopsys/hsdk/README +++ b/board/synopsys/hsdk/README @@ -82,6 +82,12 @@ Useful notes on bulding and using of U-Boot on ARC HS Development Kit (AKA HSDK) be put on the first FAT partition of micro SD-card to be inserted in the HSDK board. + Note that Python3 script is used for generation of a header, thus + to get that done it's required to have Python3 with elftools installed. + On CentOS/RHEL/Fedora this could be installed with: + ------------------------->8---------------------- + sudo dnf install python3-pyelftools + ------------------------->8---------------------- EXECUTING U-BOOT @@ -104,8 +110,8 @@ Useful notes on bulding and using of U-Boot on ARC HS Development Kit (AKA HSDK) 1. Create `u-boot.head` and `u-boot-update.scr` as discribed above with `make bsp-generate` command. - 2. Copy `u-boot.head` and `u-boot-update.scr` to the first the first FAT - partition of micro SD-card. + 2. Copy `u-boot.head` and `u-boot-update.scr` to the first FAT partition + of micro SD-card. 3. Connect USB cable from the HSDK board to the developemnt host and fire-up serial terminal. diff --git a/board/synopsys/hsdk/config.mk b/board/synopsys/hsdk/config.mk index 16fb59c438..9e280f921a 100644 --- a/board/synopsys/hsdk/config.mk +++ b/board/synopsys/hsdk/config.mk @@ -6,6 +6,6 @@ bsp-generate: u-boot u-boot.bin $(Q)python3 $(srctree)/board/$(BOARDDIR)/headerize-hsdk.py \ --arc-id 0x52 --image $(srctree)/u-boot.bin \ --elf $(srctree)/u-boot - $(Q)mkimage -T script -C none -n 'uboot update script' \ + $(Q)tools/mkimage -T script -C none -n 'uboot update script' \ -d $(srctree)/u-boot-update.txt \ $(srctree)/u-boot-update.scr &> /dev/null diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c index 147ff0b2f0..a359d20021 100644 --- a/board/ti/am335x/board.c +++ b/board/ti/am335x/board.c @@ -725,6 +725,8 @@ int board_late_init(void) if (board_is_bbg1()) name = "BBG1"; + if (board_is_bben()) + name = "BBEN"; set_board_info_env(name); /* @@ -870,7 +872,7 @@ int board_eth_init(bd_t *bis) (defined(CONFIG_SPL_ETH_SUPPORT) && defined(CONFIG_SPL_BUILD)) #ifdef CONFIG_DRIVER_TI_CPSW - if (board_is_bone() || board_is_bone_lt() || + if (board_is_bone() || board_is_bone_lt() || board_is_bben() || board_is_idk()) { writel(MII_MODE_ENABLE, &cdev->miisel); cpsw_slaves[0].phy_if = cpsw_slaves[1].phy_if = @@ -906,7 +908,7 @@ int board_eth_init(bd_t *bis) #define AR8051_DEBUG_RGMII_CLK_DLY_REG 0x5 #define AR8051_RGMII_TX_CLK_DLY 0x100 - if (board_is_evm_sk() || board_is_gp_evm()) { + if (board_is_evm_sk() || board_is_gp_evm() || board_is_bben()) { const char *devname; devname = miiphy_get_current_dev(); diff --git a/board/ti/am335x/board.h b/board/ti/am335x/board.h index 652b10b5e4..48df914af9 100644 --- a/board/ti/am335x/board.h +++ b/board/ti/am335x/board.h @@ -43,9 +43,15 @@ static inline int board_is_bbg1(void) return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "BBG1", 4); } +static inline int board_is_bben(void) +{ + return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "SE", 2); +} + static inline int board_is_beaglebonex(void) { - return board_is_pb() || board_is_bone() || board_is_bone_lt() || board_is_bbg1(); + return board_is_pb() || board_is_bone() || board_is_bone_lt() || + board_is_bbg1() || board_is_bben(); } static inline int board_is_evm_sk(void) diff --git a/board/ti/am335x/mux.c b/board/ti/am335x/mux.c index aa187605d0..41333f93f4 100644 --- a/board/ti/am335x/mux.c +++ b/board/ti/am335x/mux.c @@ -380,6 +380,13 @@ void enable_board_pin_mux(void) configure_module_pin_mux(rgmii1_pin_mux); configure_module_pin_mux(mmc0_pin_mux_sk_evm); } else if (board_is_bone_lt()) { + if (board_is_bben()) { + /* SanCloud Beaglebone LT Enhanced pinmux */ + configure_module_pin_mux(rgmii1_pin_mux); + } else { + /* Beaglebone LT pinmux */ + configure_module_pin_mux(mii1_pin_mux); + } /* Beaglebone LT pinmux */ configure_module_pin_mux(mii1_pin_mux); configure_module_pin_mux(mmc0_pin_mux); |