diff options
Diffstat (limited to 'board')
-rw-r--r-- | board/logicpd/omap3som/README | 19 | ||||
-rw-r--r-- | board/logicpd/omap3som/omap3logic.c | 18 | ||||
-rw-r--r-- | board/raspberrypi/rpi/rpi.c | 64 |
3 files changed, 41 insertions, 60 deletions
diff --git a/board/logicpd/omap3som/README b/board/logicpd/omap3som/README new file mode 100644 index 0000000000..06b3998ac0 --- /dev/null +++ b/board/logicpd/omap3som/README @@ -0,0 +1,19 @@ +Summary +======= + +The source for omap3som encompases the DM3730 SOM-LV and DM3730 Torpedo platforms. + +By default, the Torpedo Device Tree is integrated into U-Boot,but the MMC controller, GPIO and I2C controllers are the same, so for the purposes of loading U-Boot, it should be sufficient. However this will display the Model as "LogicPD Zoom DM3730 Torpedo + Wireless Development Kit" upon boot. + +The actual board remains autodetected and the Board will read "DM37xx SOM LV" when used on the DM37 SOM-LV. The device tree loaded with Linux is also correct. + +Integrating the SOM-LV Device Tree into U-Boot +============================================== + +This step is optional, but should you want to change the default to the SOM-LV, locate the configs/omap3_logic_defconfig file and make the following change. + + CONFIG_DEFAULT_DEVICE_TREE="logicpd-som-lv-37xx-devkit" + + make distclean + make omap3_logic_defconfig + diff --git a/board/logicpd/omap3som/omap3logic.c b/board/logicpd/omap3som/omap3logic.c index 4ad496e5e2..ce17db6bf9 100644 --- a/board/logicpd/omap3som/omap3logic.c +++ b/board/logicpd/omap3som/omap3logic.c @@ -36,16 +36,8 @@ DECLARE_GLOBAL_DATA_PTR; -#define CONTROL_WKUP_CTRL 0x48002a5c -#define GPIO_IO_PWRDNZ (1 << 6) -#define PBIASLITEVMODE1 (1 << 8) - -/* - * two dimensional array of strucures containining board name and Linux - * machine IDs; row it selected based on CPU column is slected based - * on hsusb0_data5 pin having a pulldown resistor - */ - +/* This is only needed until SPL gets OF support */ +#ifdef CONFIG_SPL_BUILD static const struct ns16550_platdata omap3logic_serial = { .base = OMAP34XX_UART1, .reg_shift = 2, @@ -57,7 +49,13 @@ U_BOOT_DEVICE(omap3logic_uart) = { "ns16550_serial", &omap3logic_serial }; +#endif +/* + * two dimensional array of strucures containining board name and Linux + * machine IDs; row it selected based on CPU column is slected based + * on hsusb0_data5 pin having a pulldown resistor + */ static struct board_id { char *name; int machine_id; diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index 2146534b36..d3c6ba580f 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -16,19 +16,21 @@ #include <mmc.h> #include <asm/gpio.h> #include <asm/arch/mbox.h> +#include <asm/arch/msg.h> #include <asm/arch/sdhci.h> #include <asm/global_data.h> #include <dm/platform_data/serial_bcm283x_mu.h> #ifdef CONFIG_ARM64 #include <asm/armv8/mmu.h> #endif +#include <watchdog.h> DECLARE_GLOBAL_DATA_PTR; /* From lowlevel_init.S */ extern unsigned long fw_dtb_pointer; - +/* TODO(sjg@chromium.org): Move these to the msg.c file */ struct msg_get_arm_mem { struct bcm2835_mbox_hdr hdr; struct bcm2835_mbox_tag_get_arm_mem get_arm_mem; @@ -53,12 +55,6 @@ struct msg_get_mac_address { u32 end_tag; }; -struct msg_set_power_state { - struct bcm2835_mbox_hdr hdr; - struct bcm2835_mbox_tag_set_power_state set_power_state; - u32 end_tag; -}; - struct msg_get_clock_rate { struct bcm2835_mbox_hdr hdr; struct bcm2835_mbox_tag_get_clock_rate get_clock_rate; @@ -365,30 +361,6 @@ int misc_init_r(void) return 0; } -static int power_on_module(u32 module) -{ - ALLOC_CACHE_ALIGN_BUFFER(struct msg_set_power_state, msg_pwr, 1); - int ret; - - BCM2835_MBOX_INIT_HDR(msg_pwr); - BCM2835_MBOX_INIT_TAG(&msg_pwr->set_power_state, - SET_POWER_STATE); - msg_pwr->set_power_state.body.req.device_id = module; - msg_pwr->set_power_state.body.req.state = - BCM2835_MBOX_SET_POWER_STATE_REQ_ON | - BCM2835_MBOX_SET_POWER_STATE_REQ_WAIT; - - ret = bcm2835_mbox_call_prop(BCM2835_MBOX_PROP_CHAN, - &msg_pwr->hdr); - if (ret) { - printf("bcm2835: Could not set module %u power state\n", - module); - return -1; - } - - return 0; -} - static void get_board_rev(void) { ALLOC_CACHE_ALIGN_BUFFER(struct msg_get_board_rev, msg, 1); @@ -484,6 +456,9 @@ static void rpi_disable_inactive_uart(void) int board_init(void) { +#ifdef CONFIG_HW_WATCHDOG + hw_watchdog_init(); +#endif #ifndef CONFIG_PL01X_SERIAL rpi_disable_inactive_uart(); #endif @@ -492,28 +467,17 @@ int board_init(void) gd->bd->bi_boot_params = 0x100; - return power_on_module(BCM2835_MBOX_POWER_DEVID_USB_HCD); + return bcm2835_power_on_module(BCM2835_MBOX_POWER_DEVID_USB_HCD); } -int board_mmc_init(bd_t *bis) +/* + * If the firmware passed a device tree use it for U-Boot. + */ +void *board_fdt_blob_setup(void) { - ALLOC_CACHE_ALIGN_BUFFER(struct msg_get_clock_rate, msg_clk, 1); - int ret; - - power_on_module(BCM2835_MBOX_POWER_DEVID_SDHCI); - - BCM2835_MBOX_INIT_HDR(msg_clk); - BCM2835_MBOX_INIT_TAG(&msg_clk->get_clock_rate, GET_CLOCK_RATE); - msg_clk->get_clock_rate.body.req.clock_id = BCM2835_MBOX_CLOCK_ID_EMMC; - - ret = bcm2835_mbox_call_prop(BCM2835_MBOX_PROP_CHAN, &msg_clk->hdr); - if (ret) { - printf("bcm2835: Could not query eMMC clock rate\n"); - return -1; - } - - return bcm2835_sdhci_init(BCM2835_SDHCI_BASE, - msg_clk->get_clock_rate.body.resp.rate_hz); + if (fdt_magic(fw_dtb_pointer) != FDT_MAGIC) + return NULL; + return (void *)fw_dtb_pointer; } int ft_board_setup(void *blob, bd_t *bd) |