From: Sjoerd Simons Date: Thu, 30 Jul 2015 10:46:53 +0200 Subject: [U-Boot] [PATCH v3 7/8] ARM64: hikey: hi6220: Add u-boot support for the 96boards CE HiKey board. In-Reply-To: <1438205976-11105-8-git-send-email-peter.griffin@linaro.org> References: <1438205976-11105-1-git-send-email-peter.griffin@linaro.org> <1438205976-11105-8-git-send-email-peter.griffin@linaro.org> Message-ID: <1438246013.3969.185.camel@collabora.co.uk> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, 2015-07-29 at 22:39 +0100, Peter Griffin wrote: > HiKey is the first 96boards consumer edition compliant board. It > features a hi6220 > SoC which has eight ARM A53 cpu's. > > This initial port adds support for: - > 1) Serial > 2) eMMC / SD card > 3) USB > 4) GPIO > > It has been tested with Arm Trusted Firmware running u-boot as the > BL33 executable. > > Notes: > > eMMC has been tested with basic reading of eMMC partition into DDR. I > have not > tested writing / erasing. Due to lack of clock control it won't be > running in the most performant high speed mode. > > SD card slot has been tested for reading and booting kernels into > DDR. > It is also currently configured to save the u-boot environment to the > SD card. > > USB has been tested with ASIX networking adapter to tftpboot kernels > into DDR. On v2015.07-rc2 dhcp now works, and also USB mass storage > are correctly enumerated. > > GPIO has been tested using gpio toggle GPIO4_1-3 to flash the LEDs. > > Basic SoC datasheet can be found here: - > https://github.com/96boards/documentation/blob/master/hikey/ > Hi6220V100_Multi-Mode_Application_Processor_Function_Description.pdf > > Board schematic can be found here: - > https://github.com/96boards/documentation/blob/master/hikey/ > 96Boards-Hikey-Rev-A1.pdf > > Signed-off-by: Peter Griffin > - > diff --git a/include/configs/hikey.h b/include/configs/hikey.h > new file mode 100644 > index 0000000..6bb0b7d > --- /dev/null > +++ b/include/configs/hikey.h > @@ -0,0 +1,159 @@ > > +/* SD/MMC configuration */ > +#define CONFIG_GENERIC_MMC > +#define CONFIG_MMC > +#define CONFIG_DWMMC > +#define CONFIG_HIKEY_DWMMC > +#define CONFIG_BOUNCE_BUFFER > +#define CONFIG_CMD_MMC > + > +#define CONFIG_FS_EXT4 > + > +/* Command line configuration */ > +#define CONFIG_MENU > +#define CONFIG_CMD_CACHE > +#define CONFIG_CMD_UNZIP > +#define CONFIG_CMD_ENV > + > +#define CONFIG_MTD_PARTITIONS > + > +/* BOOTP options */ > +#define CONFIG_BOOTP_BOOTFILESIZE > + > +#include > + > +/* Initial environment variables */ > + > +/* > + * Defines where the kernel and FDT will be put in RAM > + */ > + > +#define CONFIG_EXTRA_ENV_SETTINGS \ > + "kernel_name=Image\0" \ > + "kernel_addr_r=0x00080000\0" \ > + "fdt_name=hi6220-hikey.dtb\0" \ > + "fdt_addr_r=0x02000000\0" \ > + "fdt_high=0xffffffffffffffff\0" \ > + "initrd_high=0xffffffffffffffff\0" \ > + > +/* Assume we boot with root on the seventh partition of eMMC */ > +#define CONFIG_BOOTARGS "console=ttyAMA0,115200n8 > root=/dev/mmcblk0p9 rw" > + > +/* Copy the kernel and FDT to DRAM memory and boot */ > +#define CONFIG_BOOTCOMMAND "usb start; dhcp;" \ > + "tftp $kernel_addr_r $kernel_name;" > \ > + "tftp $fdt_addr_r $fdt_name;" \ > + "booti $kernel_addr_r - $fdt_addr_r" Why not use config_distro_bootcmd.h to get a somewhat standard boot sequence rather then hardcoding a tftp boot and a rootfs on a specific mmc partition? > +#define CONFIG_BOOTDELAY 2 This redefines the default in config_distro_defaults > + > +/* Preserve enviroment on sd card */ > +#define CONFIG_COMMAND_HISTORY > + > +#define CONFIG_ENV_SIZE 0x1000 > +#define CONFIG_ENV_IS_IN_FAT > +#define FAT_ENV_INTERFACE "mmc" > +#define FAT_ENV_DEVICE_AND_PART "1:1" > +#define FAT_ENV_FILE "uboot.env" > +#define CONFIG_FAT_WRITE > +#define CONFIG_ENV_VARS_UBOOT_CONFIG > + > +/* Monitor Command Prompt */ > +#define CONFIG_SYS_CBSIZE 512 /* Console I/O > Buffer Size */ > +#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ > + sizeof(CONFIG_SYS_PROMPT) + > 16) > +#define CONFIG_SYS_HUSH_PARSER > +#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE > +#define CONFIG_SYS_LONGHELP > +#define CONFIG_CMDLINE_EDITING > +#define CONFIG_SYS_MAXARGS 64 /* max command args > */ > + > +#define CONFIG_SYS_NO_FLASH > + > +#endif /* __HIKEY_H */ -- Sjoerd Simons Collabora Ltd.