From 065dcacf398ef55ed5672c2b914130756c4e6670 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Thu, 5 Apr 2018 11:36:22 +0200 Subject: rpi: Allow to boot without serial When we enable CONFIG_OF_BOARD on Raspberry Pis, we may end up without serial console support in early boot. Hence we need to make the serial port optional, otherwise we will never get to the point where serial would be probed. Signed-off-by: Alexander Graf --- configs/rpi_0_w_defconfig | 1 + configs/rpi_2_defconfig | 1 + configs/rpi_defconfig | 1 + 3 files changed, 3 insertions(+) diff --git a/configs/rpi_0_w_defconfig b/configs/rpi_0_w_defconfig index 04717d5..6e02cf3 100644 --- a/configs/rpi_0_w_defconfig +++ b/configs/rpi_0_w_defconfig @@ -34,3 +34,4 @@ CONFIG_SYS_WHITE_ON_BLACK=y CONFIG_CONSOLE_SCROLL_LINES=10 CONFIG_PHYS_TO_BUS=y CONFIG_OF_LIBFDT_OVERLAY=y +# CONFIG_REQUIRE_SERIAL_CONSOLE is not set diff --git a/configs/rpi_2_defconfig b/configs/rpi_2_defconfig index f8203c9..dd3c60c 100644 --- a/configs/rpi_2_defconfig +++ b/configs/rpi_2_defconfig @@ -34,3 +34,4 @@ CONFIG_SYS_WHITE_ON_BLACK=y CONFIG_CONSOLE_SCROLL_LINES=10 CONFIG_PHYS_TO_BUS=y CONFIG_OF_LIBFDT_OVERLAY=y +# CONFIG_REQUIRE_SERIAL_CONSOLE is not set diff --git a/configs/rpi_defconfig b/configs/rpi_defconfig index d13d3d3..2c0412d 100644 --- a/configs/rpi_defconfig +++ b/configs/rpi_defconfig @@ -34,3 +34,4 @@ CONFIG_SYS_WHITE_ON_BLACK=y CONFIG_CONSOLE_SCROLL_LINES=10 CONFIG_PHYS_TO_BUS=y CONFIG_OF_LIBFDT_OVERLAY=y +# CONFIG_REQUIRE_SERIAL_CONSOLE is not set -- cgit v1.1 From 0d1a6c5e525654aa0bc498db960bc8195e9ac2a1 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Thu, 15 Mar 2018 15:05:36 +0100 Subject: rpi3: Enable lan78xx driver The new Raspberry Pi B 3+ has a lan78xx device attached to it. Let's add driver support in U-Boot for it. Signed-off-by: Alexander Graf --- configs/rpi_3_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/rpi_3_defconfig b/configs/rpi_3_defconfig index 0f3a54e..810b603 100644 --- a/configs/rpi_3_defconfig +++ b/configs/rpi_3_defconfig @@ -36,3 +36,5 @@ CONFIG_SYS_WHITE_ON_BLACK=y CONFIG_CONSOLE_SCROLL_LINES=10 CONFIG_PHYS_TO_BUS=y CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_PHYLIB=y +CONFIG_USB_ETHER_LAN78XX=y -- cgit v1.1 From 7fe77226aa29f517ec4b503df784164c0183bae6 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Thu, 15 Mar 2018 15:05:37 +0100 Subject: rpi: Add identifier for the new RPi3 B+ The Raspberr Pi Foundation released a new RPi3 version which we want to detect as well, so we can enable ethernet on it and know the correct device tree file name. Add an identifier for it. Signed-off-by: Alexander Graf --- board/raspberrypi/rpi/rpi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index 177f4af..279a9c3 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -111,6 +111,11 @@ static const struct rpi_model rpi_models_new_scheme[] = { DTB_DIR "bcm2835-rpi-zero-w.dtb", false, }, + [0xD] = { + "3 Model B+", + DTB_DIR "bcm2837-rpi-3-b-plus.dtb", + true, + }, }; static const struct rpi_model rpi_models_old_scheme[] = { -- cgit v1.1 From 79153ff0c4383ff45d11be1e52ad94a1d24240f8 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Fri, 16 Mar 2018 06:26:29 +0000 Subject: rpi3_32b: Enable lan78xx driver The new Raspberry Pi B 3+ has a lan78xx device attached to it. Let's add driver support in U-Boot for it. Signed-off-by: Peter Robinson Signed-off-by: Alexander Graf --- configs/rpi_3_32b_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/rpi_3_32b_defconfig b/configs/rpi_3_32b_defconfig index 317fc28..4e59c14 100644 --- a/configs/rpi_3_32b_defconfig +++ b/configs/rpi_3_32b_defconfig @@ -36,3 +36,5 @@ CONFIG_SYS_WHITE_ON_BLACK=y CONFIG_CONSOLE_SCROLL_LINES=10 CONFIG_PHYS_TO_BUS=y CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_PHYLIB=y +CONFIG_USB_ETHER_LAN78XX=y -- cgit v1.1 From 8ae1f8298820a19380bafc07ad554bd629cc27be Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Sat, 17 Mar 2018 16:15:48 +1100 Subject: mmc: use core clock frequency in bcm2835 sdhost In raspberrypi-firmware 7fdcd00e00a42a1c91e8bd6f5eb8352fe9358557 and later start.elf now sets the EMMC clock to 200 MHz. According to Phil Elwell in https://github.com/raspberrypi/firmware/issues/953 the SDHost controller shares the core/VPU clock and doesn't use the EMMC clock. Use the core clock id when determining the frequency to allow U-Boot to work with recent versions of raspberrypi-firmware. Otherwise U-Boot hangs at: U-Boot 2018.03 (Mar 14 2018 - 20:36:00 +1100) DRAM: 948 MiB RPI 3 Model B (0xa02082) MMC: mmc@7e202000: 0, sdhci@7e300000: 1 Loading Environment from FAT... Signed-off-by: Jonathan Gray Signed-off-by: Alexander Graf --- arch/arm/mach-bcm283x/include/mach/msg.h | 3 ++- arch/arm/mach-bcm283x/msg.c | 4 ++-- drivers/mmc/bcm2835_sdhci.c | 2 +- drivers/mmc/bcm2835_sdhost.c | 3 ++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-bcm283x/include/mach/msg.h b/arch/arm/mach-bcm283x/include/mach/msg.h index 478b1f1..d055480 100644 --- a/arch/arm/mach-bcm283x/include/mach/msg.h +++ b/arch/arm/mach-bcm283x/include/mach/msg.h @@ -18,9 +18,10 @@ int bcm2835_power_on_module(u32 module); /** * bcm2835_get_mmc_clock() - get the frequency of the MMC clock * + * @clock_id: ID of clock to get frequency for * @return clock frequency, or -ve on error */ -int bcm2835_get_mmc_clock(void); +int bcm2835_get_mmc_clock(u32 clock_id); /** * bcm2835_get_video_size() - get the current display size diff --git a/arch/arm/mach-bcm283x/msg.c b/arch/arm/mach-bcm283x/msg.c index 92e93ad..ad29f3b 100644 --- a/arch/arm/mach-bcm283x/msg.c +++ b/arch/arm/mach-bcm283x/msg.c @@ -65,7 +65,7 @@ int bcm2835_power_on_module(u32 module) return 0; } -int bcm2835_get_mmc_clock(void) +int bcm2835_get_mmc_clock(u32 clock_id) { ALLOC_CACHE_ALIGN_BUFFER(struct msg_get_clock_rate, msg_clk, 1); int ret; @@ -76,7 +76,7 @@ int bcm2835_get_mmc_clock(void) 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; + msg_clk->get_clock_rate.body.req.clock_id = clock_id; ret = bcm2835_mbox_call_prop(BCM2835_MBOX_PROP_CHAN, &msg_clk->hdr); if (ret) { diff --git a/drivers/mmc/bcm2835_sdhci.c b/drivers/mmc/bcm2835_sdhci.c index 3157354..08bddd4 100644 --- a/drivers/mmc/bcm2835_sdhci.c +++ b/drivers/mmc/bcm2835_sdhci.c @@ -183,7 +183,7 @@ static int bcm2835_sdhci_probe(struct udevice *dev) if (base == FDT_ADDR_T_NONE) return -EINVAL; - ret = bcm2835_get_mmc_clock(); + ret = bcm2835_get_mmc_clock(BCM2835_MBOX_CLOCK_ID_EMMC); if (ret < 0) { debug("%s: Failed to set MMC clock (err=%d)\n", __func__, ret); return ret; diff --git a/drivers/mmc/bcm2835_sdhost.c b/drivers/mmc/bcm2835_sdhost.c index 1bf52a3..bccd182 100644 --- a/drivers/mmc/bcm2835_sdhost.c +++ b/drivers/mmc/bcm2835_sdhost.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -941,7 +942,7 @@ static int bcm2835_probe(struct udevice *dev) if (!host->ioaddr) return -ENOMEM; - host->max_clk = bcm2835_get_mmc_clock(); + host->max_clk = bcm2835_get_mmc_clock(BCM2835_MBOX_CLOCK_ID_CORE); bcm2835_add_host(host); -- cgit v1.1 From 91e1bc53c4b61cd7b871d485f4c136084245e9a2 Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Fri, 6 Apr 2018 18:45:49 +1000 Subject: rpi: Complete table of models with new revision code scheme In the model table for the new revision code encoding documented in https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md add the entries for old models with the new scheme and add CM3 which only appears in the new scheme. A device tree for CM3 is not currently upstreamed in linux. When that happens the name will likely have to be adjusted in the table. Signed-off-by: Jonathan Gray Signed-off-by: Alexander Graf --- board/raspberrypi/rpi/rpi.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index 279a9c3..de8e308 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -91,11 +91,36 @@ static const struct rpi_model rpi_model_unknown = { }; static const struct rpi_model rpi_models_new_scheme[] = { + [0x0] = { + "Model A", + DTB_DIR "bcm2835-rpi-a.dtb", + false, + }, + [0x1] = { + "Model B", + DTB_DIR "bcm2835-rpi-b.dtb", + true, + }, + [0x2] = { + "Model A+", + DTB_DIR "bcm2835-rpi-a-plus.dtb", + false, + }, + [0x3] = { + "Model B+", + DTB_DIR "bcm2835-rpi-b-plus.dtb", + true, + }, [0x4] = { "2 Model B", DTB_DIR "bcm2836-rpi-2-b.dtb", true, }, + [0x6] = { + "Compute Module", + DTB_DIR "bcm2835-rpi-cm.dtb", + false, + }, [0x8] = { "3 Model B", DTB_DIR "bcm2837-rpi-3-b.dtb", @@ -106,6 +131,11 @@ static const struct rpi_model rpi_models_new_scheme[] = { DTB_DIR "bcm2835-rpi-zero.dtb", false, }, + [0xA] = { + "Compute Module 3", + DTB_DIR "bcm2837-rpi-cm3.dtb", + false, + }, [0xC] = { "Zero W", DTB_DIR "bcm2835-rpi-zero-w.dtb", -- cgit v1.1