X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=board%2Fxilinx%2Fzynqmp%2Fzynqmp.c;h=b94936474d7e3fa157e39ff605e156d89224747b;hb=44fb0d6c9f5147a41c710032869e5e01b3c9e310;hp=5189925beb3aaea657635f9d12e8b466f59f4102;hpb=1f4ae66eaab29bfb5d1eb44996f7826c9cd01ed1;p=platform%2Fkernel%2Fu-boot.git diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index 5189925b..b949364 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -5,6 +5,7 @@ */ #include +#include #include #include #include @@ -20,13 +21,13 @@ #include #include #include +#include #include +#include -DECLARE_GLOBAL_DATA_PTR; +#include "pm_cfg_obj.h" -#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_WDT) -static struct udevice *watchdog_dev __attribute__((section(".data"))) = NULL; -#endif +DECLARE_GLOBAL_DATA_PTR; #if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_ZYNQMPPL) && \ !defined(CONFIG_SPL_BUILD) @@ -174,6 +175,14 @@ static const struct { .id = 0x66, .name = "39dr", }, + { + .id = 0x7b, + .name = "48dr", + }, + { + .id = 0x7e, + .name = "49dr", + }, }; #endif @@ -309,18 +318,6 @@ static char *zynqmp_get_silicon_idcode_name(void) int board_early_init_f(void) { int ret = 0; -#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_CLK_ZYNQMP) - u32 pm_api_version; - - pm_api_version = zynqmp_pmufw_version(); - printf("PMUFW:\tv%d.%d\n", - pm_api_version >> ZYNQMP_PM_VERSION_MAJOR_SHIFT, - pm_api_version & ZYNQMP_PM_VERSION_MINOR_MASK); - - if (pm_api_version < ZYNQMP_PM_VERSION) - panic("PMUFW version error. Expected: v%d.%d\n", - ZYNQMP_PM_VERSION_MAJOR, ZYNQMP_PM_VERSION_MINOR); -#endif #if defined(CONFIG_ZYNQMP_PSU_INIT_ENABLED) ret = psu_init(); @@ -331,6 +328,19 @@ int board_early_init_f(void) int board_init(void) { + struct udevice *dev; + + uclass_get_device_by_name(UCLASS_FIRMWARE, "zynqmp-power", &dev); + if (!dev) + panic("PMU Firmware device not found - Enable it"); + +#if defined(CONFIG_SPL_BUILD) + /* Check *at build time* if the filename is an non-empty string */ + if (sizeof(CONFIG_ZYNQMP_SPL_PM_CFG_OBJ_FILE) > 1) + zynqmp_pmufw_load_config_object(zynqmp_pm_cfg_obj, + zynqmp_pm_cfg_obj_size); +#endif + printf("EL Level:\tEL%d\n", current_el()); #if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_ZYNQMPPL) && \ @@ -344,44 +354,9 @@ int board_init(void) } #endif -#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_WDT) - if (uclass_get_device_by_seq(UCLASS_WDT, 0, &watchdog_dev)) { - debug("Watchdog: Not found by seq!\n"); - if (uclass_get_device(UCLASS_WDT, 0, &watchdog_dev)) { - puts("Watchdog: Not found!\n"); - return 0; - } - } - - wdt_start(watchdog_dev, 0, 0); - puts("Watchdog: Started\n"); -#endif - return 0; } -#ifdef CONFIG_WATCHDOG -/* Called by macro WATCHDOG_RESET */ -void watchdog_reset(void) -{ -# if !defined(CONFIG_SPL_BUILD) - static ulong next_reset; - ulong now; - - if (!watchdog_dev) - return; - - now = timer_get_us(); - - /* Do not reset the watchdog too often */ - if (now > next_reset) { - wdt_reset(watchdog_dev); - next_reset = now + 1000; - } -# endif -} -#endif - int board_early_init_r(void) { u32 val; @@ -559,6 +534,7 @@ int board_late_init(void) char *new_targets; char *env_targets; int ret; + ulong initrd_hi; #if defined(CONFIG_USB_ETHER) && !defined(CONFIG_USB_GADGET_DOWNLOAD) usb_ether_init(); @@ -591,7 +567,7 @@ int board_late_init(void) break; case JTAG_MODE: puts("JTAG_MODE\n"); - mode = "pxe dhcp"; + mode = "jtag pxe dhcp"; env_set("modeboot", "jtagboot"); break; case QSPI_MODE_24BIT: @@ -676,6 +652,10 @@ int board_late_init(void) env_set("boot_targets", new_targets); + initrd_hi = gd->start_addr_sp - CONFIG_STACK_SIZE; + initrd_hi = round_down(initrd_hi, SZ_16M); + env_set_addr("initrd_high", (void *)initrd_hi); + reset_reason(); return 0;