diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/configs/rpi.h | 134 | ||||
-rw-r--r-- | include/event.h | 115 | ||||
-rw-r--r-- | include/video.h | 2 |
3 files changed, 102 insertions, 149 deletions
diff --git a/include/configs/rpi.h b/include/configs/rpi.h index 4da982f7357..8e56bdc84a8 100644 --- a/include/configs/rpi.h +++ b/include/configs/rpi.h @@ -13,8 +13,6 @@ #include <asm/arch/base.h> #endif -/* Architecture, CPU, etc.*/ - /* Use SoC timer for AArch32, but architected timer for AArch64 */ #ifndef CONFIG_ARM64 #define CFG_SYS_TIMER_RATE 1000000 @@ -33,136 +31,4 @@ */ #define CFG_SYS_SDRAM_SIZE SZ_128M -/* Devices */ -/* LCD */ - -/* DFU over USB/UDC */ -#ifdef CONFIG_CMD_DFU -#ifdef CONFIG_ARM64 -#define KERNEL_FILENAME "Image" -#else -#define KERNEL_FILENAME "zImage" -#endif - -#define ENV_DFU_SETTINGS \ - "dfu_alt_info=u-boot.bin fat 0 1;uboot.env fat 0 1;" \ - "config.txt fat 0 1;" \ - KERNEL_FILENAME " fat 0 1\0" -#else -#define ENV_DFU_SETTINGS "" -#endif - -/* Console configuration */ - -/* Environment */ - -/* Shell */ - -/* Environment */ -#define ENV_DEVICE_SETTINGS \ - "stdin=serial,usbkbd\0" \ - "stdout=serial,vidconsole\0" \ - "stderr=serial,vidconsole\0" - -#ifdef CONFIG_ARM64 -#define FDT_HIGH "ffffffffffffffff" -#define INITRD_HIGH "ffffffffffffffff" -#else -#define FDT_HIGH "ffffffff" -#define INITRD_HIGH "ffffffff" -#endif - -/* - * Memory layout for where various images get loaded by boot scripts: - * - * I suspect address 0 is used as the SMP pen on the RPi2, so avoid this. - * - * Older versions of the boot firmware place the firmware-loaded DTB at 0x100, - * newer versions place it in high memory. So prevent U-Boot from doing its own - * DTB + initrd relocation so that we won't accidentally relocate the initrd - * over the firmware-loaded DTB and generally try to lay out things starting - * from the bottom of RAM. - * - * kernel_addr_r has different constraints on ARM and Aarch64. For 32-bit ARM, - * it must be within the first 128M of RAM in order for the kernel's - * CONFIG_AUTO_ZRELADDR option to work. The kernel itself will be decompressed - * to 0x8000 but the decompressor clobbers 0x4000-0x8000 as well. The - * decompressor also likes to relocate itself to right past the end of the - * decompressed kernel, so in total the sum of the compressed and and - * decompressed kernel needs to be reserved. - * - * For Aarch64, the kernel image is uncompressed and must be loaded at - * text_offset bytes (specified in the header of the Image) into a 2MB - * boundary. The 'booti' command relocates the image if necessary. Linux uses - * a default text_offset of 0x80000. In summary, loading at 0x80000 - * satisfies all these constraints and reserving memory up to 0x02400000 - * permits fairly large (roughly 36M) kernels. - * - * scriptaddr and pxefile_addr_r can be pretty much anywhere that doesn't - * conflict with something else. Reserving 1M for each of them at - * 0x02400000-0x02500000 and 0x02500000-0x02600000 should be plenty. - * - * On ARM, both the DTB and any possible initrd must be loaded such that they - * fit inside the lowmem mapping in Linux. In practice, this usually means not - * more than ~700M away from the start of the kernel image but this number can - * be larger OR smaller depending on e.g. the 'vmalloc=xxxM' command line - * parameter given to the kernel. So reserving memory from low to high - * satisfies this constraint again. Reserving 1M at 0x02600000-0x02700000 for - * the DTB leaves rest of the free RAM to the initrd starting at 0x02700000. - * Even with the smallest possible CPU-GPU memory split of the CPU getting - * only 64M, the remaining 25M starting at 0x02700000 should allow quite - * large initrds before they start colliding with U-Boot. - */ -#define ENV_MEM_LAYOUT_SETTINGS \ - "fdt_high=" FDT_HIGH "\0" \ - "initrd_high=" INITRD_HIGH "\0" \ - "kernel_addr_r=0x00080000\0" \ - "scriptaddr=0x02400000\0" \ - "pxefile_addr_r=0x02500000\0" \ - "fdt_addr_r=0x02600000\0" \ - "ramdisk_addr_r=0x02700000\0" - -#if IS_ENABLED(CONFIG_CMD_MMC) - #define BOOT_TARGET_MMC(func) \ - func(MMC, mmc, 0) \ - func(MMC, mmc, 1) \ - func(MMC, mmc, 2) -#else - #define BOOT_TARGET_MMC(func) -#endif - -#if IS_ENABLED(CONFIG_CMD_USB) - #define BOOT_TARGET_USB(func) func(USB, usb, 0) -#else - #define BOOT_TARGET_USB(func) -#endif - -#if CONFIG_IS_ENABLED(CMD_PXE) - #define BOOT_TARGET_PXE(func) func(PXE, pxe, na) -#else - #define BOOT_TARGET_PXE(func) -#endif - -#if CONFIG_IS_ENABLED(CMD_DHCP) - #define BOOT_TARGET_DHCP(func) func(DHCP, dhcp, na) -#else - #define BOOT_TARGET_DHCP(func) -#endif - -#define BOOT_TARGET_DEVICES(func) \ - BOOT_TARGET_MMC(func) \ - BOOT_TARGET_USB(func) \ - BOOT_TARGET_PXE(func) \ - BOOT_TARGET_DHCP(func) - -#include <config_distro_bootcmd.h> - -#define CFG_EXTRA_ENV_SETTINGS \ - "dhcpuboot=usb start; dhcp u-boot.uimg; bootm\0" \ - ENV_DEVICE_SETTINGS \ - ENV_DFU_SETTINGS \ - ENV_MEM_LAYOUT_SETTINGS \ - BOOTENV - - #endif diff --git a/include/event.h b/include/event.h index 747a9f6c654..311df878c4a 100644 --- a/include/event.h +++ b/include/event.h @@ -19,31 +19,94 @@ * @EVT_DM_PRE_PROBE: Device is about to be probed */ enum event_t { - EVT_NONE, + /** + * @EVT_NONE: This zero value is not used for events. + */ + EVT_NONE = 0, + + /** + * @EVT_TEST: This event is used in unit tests. + */ EVT_TEST, - /* Events related to driver model */ + /** + * @EVT_DM_POST_INIT_F: + * This event is triggered after pre-relocation initialization of the + * driver model. Its parameter is NULL. + * A non-zero return code from the event handler let's the boot process + * fail. + */ EVT_DM_POST_INIT_F, + + /** + * @EVT_DM_POST_INIT_R: + * This event is triggered after post-relocation initialization of the + * driver model. Its parameter is NULL. + * A non-zero return code from the event handler let's the boot process + * fail. + */ + EVT_DM_POST_INIT_R, + + /** + * @EVT_DM_PRE_PROBE: + * This event is triggered before probing a device. Its parameter is the + * device to be probed. + * A non-zero return code from the event handler lets the device not + * being probed. + */ EVT_DM_PRE_PROBE, + + /** + * @EVT_DM_POST_PROBE: + * This event is triggered after probing a device. Its parameter is the + * device that was probed. + * A non-zero return code from the event handler leaves the device in + * the unprobed state and therefore not usable. + */ EVT_DM_POST_PROBE, + + /** + * @EVT_DM_PRE_REMOVE: + * This event is triggered after removing a device. Its parameter is + * the device to be removed. + * A non-zero return code from the event handler stops the removal of + * the device before any changes. + */ EVT_DM_PRE_REMOVE, + + /** + * @EVT_DM_POST_REMOVE: + * This event is triggered before removing a device. Its parameter is + * the device that was removed. + * A non-zero return code stops from the event handler the removal of + * the device after all removal changes. The previous state is not + * restored. All children will be gone and the device may not be + * functional. + */ EVT_DM_POST_REMOVE, - /* Init hooks */ + /** + * @EVT_MISC_INIT_F: + * This event is triggered during the initialization sequence before + * relocation. Its parameter is NULL. + * A non-zero return code from the event handler let's the boot process + * fail. + */ EVT_MISC_INIT_F, - /* - * Emitted before relocation to set up Firmware Support Package - * + /** + * @EVT_FSP_INIT_F: + * This event is triggered before relocation to set up Firmware Support + * Package. * Where U-Boot relies on binary blobs to handle part of the system * init, this event can be used to set up the blobs. This is used on * some Intel platforms */ EVT_FSP_INIT_F, - /* - * Emitted just before jumping to the main loop - * + /** + * @EVT_LAST_STAGE_INIT: + * This event is triggered just before jumping to the main loop. * Some boards need to perform initialisation immediately before control * is passed to the command-line interpreter (e.g. for init that depend * on later phases in the init sequence). @@ -53,15 +116,39 @@ enum event_t { */ EVT_LAST_STAGE_INIT, - /* Fpga load hook */ + /** + * @EVT_FPGA_LOAD: + * The FPGA load hook is called after loading an FPGA with a new binary. + * Its parameter is of type struct event_fpga_load and contains + * information about the loaded image. + */ EVT_FPGA_LOAD, - /* Device tree fixups before booting */ + /** + * @EVT_FT_FIXUP: + * This event is triggered during device-tree fix up after all + * other device-tree fixups have been executed. + * Its parameter is of type struct event_ft_fixup which contains + * the address of the device-tree to fix up and the list of images to be + * booted. + * A non-zero return code from the event handler let's booting the + * images fail. + */ EVT_FT_FIXUP, - /* To be called once, before calling main_loop() */ + /** + * @EVT_MAIN_LOOP: + * This event is triggered immediately before calling main_loop() which + * is the entry point of the command line. Its parameter is NULL. + * A non-zero return value causes the boot to fail. + */ EVT_MAIN_LOOP, + /** + * @EVT_COUNT: + * This constants holds the maximum event number + 1 and is used when + * looping over all event classes. + */ EVT_COUNT }; @@ -136,7 +223,7 @@ typedef int (*event_handler_simple_t)(void); * * @func: Function to call when the event is activated (must be first) * @type: Event type - * @flag: Flags for this spy + * @flags: Flags for this spy * @id: Event id string */ struct evspy_info { @@ -155,7 +242,7 @@ struct evspy_info { * * @func: Function to call when the event is activated (must be first) * @type: Event type - * @flag: Flags for this spy + * @flags: Flags for this spy * @id: Event id string */ struct evspy_info_simple { diff --git a/include/video.h b/include/video.h index 66d109ca5da..5048116a3d5 100644 --- a/include/video.h +++ b/include/video.h @@ -260,7 +260,7 @@ int video_fill_part(struct udevice *dev, int xstart, int ystart, int xend, int video_sync(struct udevice *vid, bool force); /** - * video_sync_all() - Sync all devices' frame buffers with there hardware + * video_sync_all() - Sync all devices' frame buffers with their hardware * * This calls video_sync() on all active video devices. */ |