Revert "ARM: dts: bcm2835-rpi: re-enable booting from SD card"
Subsystems (6)
PATCH 1/11 Revert "ARM: dts: bcm2835-rpi: re-enable booting from SD card"
Since d6d3d0aecece ("mci: add driver for BCM283x sdhost core"), we now have driver support for the sdhost controller in barebox as well. We can thus drop the device tree override and use the same MCI the kernel uses. This was tested on a Raspberry Pi zero W, which has the same bcm2835 SoC as the Raspberry Pi 1.
This reverts commit abc0447440d68af720127fcca3c17f04ee144fcc.
--- arch/arm/dts/bcm2835-rpi.dts | 8 -------- 1 file changed, 8 deletions(-)
arch/arm/dts/bcm2835-rpi.dts +0 -8
@@ -9,11 +9,3 @@ &{/memory@0} { reg = <0x0 0x0>; }; - -&sdhci { - status = "okay"; -}; - -&sdhost { - status = "disabled"; -};
Signature · 7 lines
2.28.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 2/11 ARM: dts: rpi: drop unnecessary /chosen/stdout-path overrides
The upstream device trees reference the stdout-path via alias. barebox overrides them with a path to the node, but the effect is the same as both barebox and the kernel accept both for the property's value.
No functional change:
serial0 serial1 upstream stdout-path
Rpi1 &uart0 &uart1 serial0
Rpi2 &uart0 &uart1 serial0
Rpi3 &uart0 &uart1 serial1
Tested on a Raspberry Pi 3B.
--- arch/arm/dts/bcm2835-rpi.dts | 6 ------ arch/arm/dts/bcm2836-rpi-2.dts | 6 ------ arch/arm/dts/bcm2837-rpi-3.dts | 6 ------ 3 files changed, 18 deletions(-)
arch/arm/dts/bcm2835-rpi.dts +0 -6
@@ -1,11 +1,5 @@ #include <arm/bcm2835-rpi-a.dts> -/ { - chosen { - stdout-path = &uart0; - }; -}; - &{/memory@0} { reg = <0x0 0x0>; };
arch/arm/dts/bcm2836-rpi-2.dts +0 -6
@@ -1,11 +1,5 @@ #include <arm/bcm2836-rpi-2-b.dts> -/ { - chosen { - stdout-path = &uart0; - }; -}; - &{/memory@0} { reg = <0x0 0x0>; };
arch/arm/dts/bcm2837-rpi-3.dts +0 -6
@@ -1,11 +1,5 @@ #include <arm64/broadcom/bcm2837-rpi-3-b.dts> -/ { - chosen { - stdout-path = &uart1; - }; -}; - &{/memory@0} { reg = <0x0 0x0>; };
Signature · 7 lines
2.28.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 3/11 ARM: rpi: make functions in rpi-common.c static
In reply to Ahmad FatoumThey aren't (and arguably shouldn't) be used outside, so give them all internal linkage and drop the header.
--- arch/arm/boards/raspberry-pi/rpi-common.c | 22 +++++++++++++++------ arch/arm/boards/raspberry-pi/rpi.h | 24 ----------------------- 2 files changed, 16 insertions(+), 30 deletions(-) delete mode 100644 arch/arm/boards/raspberry-pi/rpi.h
arch/arm/boards/raspberry-pi/rpi-common.c +16 -6
@@ -25,9 +25,19 @@#include <mach/mbox.h> #include <mach/platform.h> -#include "rpi.h" #include "lowlevel.h" +struct rpi_model { +const char *name; +void (*init)(void ); +}; + +#define RPI_MODEL (_id, _name, _init) \ + [_id] = { \ + .name = _name,\ + .init = _init,\ + } +struct msg_get_arm_mem {struct bcm2835_mbox_hdr hdr;struct bcm2835_mbox_tag_get_arm_mem get_arm_mem;
@@ -85,7 +95,7 @@ static struct clk *rpi_register_firmware_clock(u32 clock_id, const char *name)return clk_fixed (name, msg->get_clock_rate.body.resp.rate_hz); } -void rpi_set_usbethaddr (void ) +static void rpi_set_usbethaddr (void ) { BCM2835_MBOX_STACK_ALIGN(struct msg_get_mac_address, msg);int ret;
@@ -103,7 +113,7 @@ void rpi_set_usbethaddr(void)eth_register_ethaddr (0 , msg->get_mac_address.body.resp.mac); } -struct gpio_led rpi_leds[] = { +static struct gpio_led rpi_leds[] = { { .gpio = -EINVAL , .led = {
@@ -149,7 +159,7 @@ static void rpi_b_plus_init(void) }/* See comments in mbox.h for data source */ -const struct rpi_model rpi_models_old_scheme[] = { +static const struct rpi_model rpi_models_old_scheme[] = {RPI_MODEL (0 ,"Unknown model" ,NULL ),RPI_MODEL (BCM2835_BOARD_REV_B_I2C0_2 ,"Model B (no P5)" , rpi_b_init),RPI_MODEL (BCM2835_BOARD_REV_B_I2C0_3 ,"Model B (no P5)" , rpi_b_init),
@@ -170,7 +180,7 @@ const struct rpi_model rpi_models_old_scheme[] = { RPI_MODEL(BCM2835_BOARD_REV_A_PLUS_15, "Model A+", NULL), }; -const struct rpi_model rpi_models_new_scheme[] = { +static const struct rpi_model rpi_models_new_scheme[] = {RPI_MODEL (BCM2835_BOARD_REV_A ,"Model A" ,NULL ),RPI_MODEL (BCM2835_BOARD_REV_B ,"Model B" , rpi_b_init ),RPI_MODEL (BCM2835_BOARD_REV_A_PLUS ,"Model A+" ,NULL ),
@@ -191,7 +201,7 @@ const struct rpi_model rpi_models_new_scheme[] = { };static int rpi_board_rev =0 ; -const struct rpi_model *model =NULL ; +static const struct rpi_model *model =NULL ;static void rpi_get_board_rev (void ) {
arch/arm/boards/raspberry-pi/rpi.h deleted +0 -24
@@ -1,24 +0,0 @@ -#ifndef __ARCH_ARM_BOARDS_RPI_H__ -#define __ARCH_ARM_BOARDS_RPI_H__ - -#include <types.h> -#include <led.h> - -#include <mach/mbox.h> - -#define RPI_MODEL (_id, _name, _init) \ - [_id] = { \ - .name = _name,\ - .init = _init,\ - } - -struct rpi_model { -const char *name; -void (*init)(void ); -}; - -extern struct gpio_led rpi_leds[]; - -void rpi_set_usbethaddr (void ); - -#endif /* __ARCH_ARM_BOARDS_RPI_H__ */
Signature · 7 lines
2.28.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 4/11 ARM: rpi: move rpi_model_init() to postcore
In reply to Ahmad Fatoumrpi_model_init() was so far run at late initcall level, at which time most drivers have already been probed and it's too late to modify the built-in device tree and see the changes take effect.
To use the same barebox image for multiple boards, it would be nice to be able to fix up the device tree a bit. Facilitate this by moving rpi_model_init() to postcore.
This is ok to do because eth_register_ethaddr() can be called prior to Ethernet driver probe as well. This was tested on a Raspberry Pi 3B.
--- arch/arm/boards/raspberry-pi/rpi-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boards/raspberry-pi/rpi-common.c +2 -2
@@ -279,7 +279,6 @@ static void rpi_model_init(void)return ; model->init (); -rpi_add_led (); }static int rpi_mem_init (void )
@@ -301,6 +300,7 @@ static int rpi_postcore_init(void) {rpi_get_board_rev ();barebox_set_hostname ("rpi" ); +rpi_model_init ();return 0 ; }
@@ -463,7 +463,7 @@ static int rpi_devices_init(void) {struct regulator *reg; -rpi_model_init (); +rpi_add_led ();bcm2835_register_fb ();armlinux_set_architecture (MACH_TYPE_BCM2708 );rpi_env_init ();
Signature · 7 lines
2.28.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 5/11 ARM: rpi: support raspberry pi 1 and zero mini-uart
In reply to Ahmad FatoumWe don't have a clock driver for the raspberry pi, so board code needs to list which used devices have clocks that are already known to be active on boot. The Mini UART is one such device. We already wave away the clock on the BCM2836, do the same for the BCM2835 as well.
--- arch/arm/boards/raspberry-pi/rpi-common.c | 1 + arch/arm/mach-bcm283x/include/mach/platform.h | 1 + 2 files changed, 2 insertions(+)
arch/arm/boards/raspberry-pi/rpi-common.c +1 -0
@@ -347,6 +347,7 @@ static int rpi_console_clock_init(void)if (IS_ERR (clk))return PTR_ERR (clk); +clkdev_add_physbase (clk,BCM2835_MINIUART_BASE ,NULL );clkdev_add_physbase (clk,BCM2836_MINIUART_BASE ,NULL ); clk =clk_fixed ("bcm2835-cs" ,1 *1000 *1000 );
arch/arm/mach-bcm283x/include/mach/platform.h +1 -0
@@ -32,6 +32,7 @@#define BCM2835_PL011_BASE 0x20201000#define BCM2836_PL011_BASE 0x3f201000 +#define BCM2835_MINIUART_BASE 0x20215040#define BCM2836_MINIUART_BASE 0x3f215040#endif
Signature · 7 lines
2.28.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 6/11 ARM: rpi: add new init function for Raspberry Pi Zero
In reply to Ahmad FatoumThe Raspberry Pi Zero and Zero W have no power LED and lack the USB hub and ethernet port. The rpi_b_plus_init is thus the wrong init function to use. Add a new init function that just configures the activity LED and configure the new exposed USB port for OTG.
While we have a dwc2 gadget driver, it doesn't yet work for the Rpi:
barebox@RaspberryPi Zero W:/ usbgadget -a
udc0: registering UDC driver [g_multi]
multi_bind: creating ACM function
g_multi usbgadget: Multifunction Composite Gadget g_multi usbgadget: g_multi ready
dwc2 [email protected]: bound driver g_multi
WARNING: at drivers/usb/dwc2/gadget.c:1896/dwc2_gadget_pullup()!
But let's add dr_mode = otg anyway, so it can be debugged out of the box with only config changes.
--- arch/arm/boards/raspberry-pi/rpi-common.c | 19 +++++++++++++++++-- arch/arm/dts/bcm2835-rpi.dts | 4 ++++ 2 files changed, 21 insertions(+), 2 deletions(-)
arch/arm/boards/raspberry-pi/rpi-common.c +17 -2
@@ -113,6 +113,15 @@ static void rpi_set_usbethaddr(void)eth_register_ethaddr (0 , msg->get_mac_address.body.resp.mac); } +static void rpi_set_usbotg (const char *alias) +{ +struct device_node *usb; + + usb =of_find_node_by_alias (NULL , alias); +if (usb) +of_property_write_string (usb,"dr_mode" ,"otg" ); +} +static struct gpio_led rpi_leds[] = { { .gpio = -EINVAL ,
@@ -158,6 +167,12 @@ static void rpi_b_plus_init(void)rpi_set_usbethaddr (); } +static void rpi_0_init (void ) +{ + rpi_leds[0 ].gpio =47 ; +rpi_set_usbotg ("usb0" ); +} +/* See comments in mbox.h for data source */ static const struct rpi_model rpi_models_old_scheme[] = {RPI_MODEL (0 ,"Unknown model" ,NULL ),
@@ -190,10 +205,10 @@ static const struct rpi_model rpi_models_new_scheme[] = {RPI_MODEL (BCM2835_BOARD_REV_CM1 ,"Compute Module" ,NULL ),RPI_MODEL (0x7 ,"Unknown model" ,NULL ),RPI_MODEL (BCM2837_BOARD_REV_3_B ,"Model 3B" , rpi_b_init ), -RPI_MODEL (BCM2835_BOARD_REV_ZERO ,"Zero" , rpi_b_plus_init), +RPI_MODEL (BCM2835_BOARD_REV_ZERO ,"Zero" , rpi_0_init),RPI_MODEL (BCM2837_BOARD_REV_CM3 ,"Compute Module 3" ,NULL ),RPI_MODEL (0xb ,"Unknown model" ,NULL ), -RPI_MODEL (BCM2835_BOARD_REV_ZERO_W ,"Zero W" , rpi_b_plus_init), +RPI_MODEL (BCM2835_BOARD_REV_ZERO_W ,"Zero W" , rpi_0_init),RPI_MODEL (BCM2837B0_BOARD_REV_3B_PLUS ,"Model 3 B+" , rpi_b_plus_init ),RPI_MODEL (BCM2837B0_BOARD_REV_3A_PLUS ,"Nodel 3 A+" , rpi_b_plus_init), RPI_MODEL(0xf, "Unknown model", NULL),
arch/arm/dts/bcm2835-rpi.dts +4 -0
@@ -1,5 +1,9 @@ #include <arm/bcm2835-rpi-a.dts> +&{/aliases} { + usb0 = &usb; +}; + &{/memory@0} { reg = <0x0 0x0>; };
Signature · 7 lines
2.28.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 7/11 ARM: rpi: Add Raspberry Pi Zero W mini-uart support
In reply to Ahmad FatoumUnlike the Raspberry Pi 1 and Raspberry Pi Zero, the Raspberry Pi Zero W has its console pins on the header connected to the mini-uart, not the PL011. The secondary PL011 UART is connected to the bluetooth module.
Set the mini-uart as default console and disable the PL011. That way we can use the Raspberry Pi 1 image for the Zero W as well.
--- arch/arm/boards/raspberry-pi/rpi-common.c | 23 ++++++++++++++++++++++- drivers/of/base.c | 15 +++++++++++++++ include/of.h | 1 + 3 files changed, 38 insertions(+), 1 deletion(-)
arch/arm/boards/raspberry-pi/rpi-common.c +22 -1
@@ -173,6 +173,27 @@ static void rpi_0_init(void)rpi_set_usbotg ("usb0" ); } +static void rpi_0_w_init (void ) +{ +struct device_node *np; +int ret; + +rpi_0_init (); + + np =of_find_node_by_path ("/chosen" ); +if (!np) +return ; + +if (!of_device_enable_and_register_by_alias ("serial1" )) +return ; + + ret =of_property_write_string (np,"stdout-path" ,"serial1:115200n8" ); +if (ret) +return ; + +of_device_disable_by_alias ("serial0" ); +} +/* See comments in mbox.h for data source */ static const struct rpi_model rpi_models_old_scheme[] = {RPI_MODEL (0 ,"Unknown model" ,NULL ),
@@ -208,7 +229,7 @@ static const struct rpi_model rpi_models_new_scheme[] = {RPI_MODEL (BCM2835_BOARD_REV_ZERO ,"Zero" , rpi_0_init),RPI_MODEL (BCM2837_BOARD_REV_CM3 ,"Compute Module 3" ,NULL ),RPI_MODEL (0xb ,"Unknown model" ,NULL ), -RPI_MODEL (BCM2835_BOARD_REV_ZERO_W ,"Zero W" , rpi_0_init), +RPI_MODEL (BCM2835_BOARD_REV_ZERO_W ,"Zero W" , rpi_0_w_init),RPI_MODEL (BCM2837B0_BOARD_REV_3B_PLUS ,"Model 3 B+" , rpi_b_plus_init ),RPI_MODEL (BCM2837B0_BOARD_REV_3A_PLUS ,"Nodel 3 A+" , rpi_b_plus_init), RPI_MODEL(0xf, "Unknown model", NULL),
drivers/of/base.c +15 -0
@@ -2566,6 +2566,21 @@ int of_device_disable_path(const char *path)return of_device_disable (node); } +/** +* of_device_disable_path_by_alias - disable a devicenode by alias +* @alias - the alias of the device tree node to disable +*/ +int of_device_disable_by_alias (const char *alias) +{ +struct device_node *node; + + node =of_find_node_by_alias (NULL , alias); +if (!node) +return -ENODEV ; + +return of_device_disable (node); +} +/** * of_get_reproducible_name() - get a reproducible name of a node * @node: The node to get a name from
include/of.h +1 -0
@@ -1006,6 +1006,7 @@ int of_device_enable(struct device_node *node);int of_device_enable_path (const char *path);int of_device_disable (struct device_node *node);int of_device_disable_path (const char *path); +int of_device_disable_by_alias (const char *alias);phandle of_get_tree_max_phandle (struct device_node *root);phandle of_node_create_phandle (struct device_node *node);
Signature · 7 lines
2.28.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 8/11 ARM: rpi: drop no longer needed environment
In reply to Ahmad FatoumThe barebox PL011 driver automatically arranges for the kernel to be called with the appropriate console argument (placed in ${global.linux.bootargs.console}. There is thus no need to hard code a TTY. Indeed we shouldn't because some Raspberry Pis don't use the PL011, but the mini-uart, which is a ttyS.
--- arch/arm/boards/raspberry-pi/env/init/bootargs-base | 3 --- arch/arm/configs/rpi_defconfig | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 arch/arm/boards/raspberry-pi/env/init/bootargs-base
arch/arm/boards/raspberry-pi/env/init/bootargs-base deleted +0 -3
@@ -1,3 +0,0 @@ -#!/bin/sh - -global.linux.bootargs.base="console=ttyAMA0,115200"
arch/arm/configs/rpi_defconfig +1 -1
@@ -23,7 +23,7 @@ CONFIG_BOOTM_OFTREE=y CONFIG_BLSPEC=y CONFIG_CONSOLE_ALLOW_COLOR=y CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y -CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/raspberry-pi/env" +CONFIG_DEFAULT_ENVIRONMENT_PATH="" CONFIG_CMD_DMESG=y CONFIG_LONGHELP=y CONFIG_CMD_IOMEM=y
Signature · 7 lines
2.28.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 9/11 ARM: rpi: fix model description string
In reply to Ahmad Fatoums/Model/Nodel/ as well as drop the space the other ones (e.g. Model 2B) lack.
--- arch/arm/boards/raspberry-pi/rpi-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boards/raspberry-pi/rpi-common.c +2 -2
@@ -230,8 +230,8 @@ static const struct rpi_model rpi_models_new_scheme[] = {RPI_MODEL (BCM2837_BOARD_REV_CM3 ,"Compute Module 3" ,NULL ),RPI_MODEL (0xb ,"Unknown model" ,NULL ),RPI_MODEL (BCM2835_BOARD_REV_ZERO_W ,"Zero W" , rpi_0_w_init), -RPI_MODEL (BCM2837B0_BOARD_REV_3B_PLUS ,"Model 3 B+" , rpi_b_plus_init ), -RPI_MODEL (BCM2837B0_BOARD_REV_3A_PLUS ,"Nodel 3 A+" , rpi_b_plus_init), +RPI_MODEL (BCM2837B0_BOARD_REV_3B_PLUS ,"Model 3B+" , rpi_b_plus_init ), +RPI_MODEL (BCM2837B0_BOARD_REV_3A_PLUS ,"Model 3A+" , rpi_b_plus_init),RPI_MODEL (0xf ,"Unknown model" ,NULL ), RPI_MODEL(BCM2837B0_BOARD_REV_CM3_PLUS, "Compute Module 3+", NULL), };
Signature · 7 lines
2.28.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 10/11 ARM: rpi: add new rpi boot target
In reply to Ahmad FatoumFor drop-in placement of barebox into the boot chain, it's useful to have a target to boot the kernel like the VideoCore would have booted the kernel if barebox hadn't been started instead.
This commit is based on the information here:
https://www.tablix.org/~avian/blog/archives/2019/03/booting_raspbian_from_barebox/
--- arch/arm/boards/raspberry-pi/Makefile | 1 + .../boards/raspberry-pi/defaultenv-rpi/boot/rpi | 5 +++++ arch/arm/boards/raspberry-pi/rpi-common.c | 15 +++++++++++++++ 3 files changed, 21 insertions(+) create mode 100755 arch/arm/boards/raspberry-pi/defaultenv-rpi/boot/rpi
arch/arm/boards/raspberry-pi/Makefile +1 -0
@@ -1,2 +1,3 @@ obj-$(CONFIG_MACH_RPI_COMMON) += rpi-common.o lwl-y += lowlevel.o +bbenv-y += defaultenv-rpi
arch/arm/boards/raspberry-pi/defaultenv-rpi/boot/rpi new file +5 -0
@@ -0,0 +1,5 @@ +#!/bin/sh + +global linux.bootargs.dyn.vc="${global.vc.bootargs}" +global.bootm.image="/boot/${global.vc.kernel}" +global.bootm.oftree=/vc.dtb
arch/arm/boards/raspberry-pi/rpi-common.c +15 -0
@@ -20,6 +20,7 @@#include <generated/mach-types.h> #include <linux/sizes.h> #include <globalvar.h> +#include <asm/system_info.h> #include <mach/core.h> #include <mach/mbox.h>
@@ -414,6 +415,8 @@ static int rpi_env_init(void)return 0 ; } +defaultenv_append_directory (defaultenv_rpi); +default_environment_path_set ("/boot/barebox.env" );return 0 ;
@@ -450,6 +453,18 @@ static int rpi_vc_fdt_bootargs(void *fdt)globalvar_add_simple ("vc.bootargs" , cmdline); +switch (cpu_architecture ()) { +case CPU_ARCH_ARMv6: +globalvar_add_simple ("vc.kernel" ,"kernel.img" ); +break ; +case CPU_ARCH_ARMv7: +globalvar_add_simple ("vc.kernel" ,"kernel7.img" ); +break ; +case CPU_ARCH_ARMv8: +globalvar_add_simple ("vc.kernel" ,"kernel7l.img" ); +break ; + } + out:if (root)of_delete_node (root);
Signature · 7 lines
2.28.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 11/11 doc: bcm283x: document use of mini-uart on Raspberry Pi Zero W / CM3
In reply to Ahmad FatoumAs described in the UART configuration[1] article in the Raspberry Pi Foundation documentation, Raspberry Pi 3 & 4 as well as Zero W use the mini-uart as primary (easily user-accessible) UART. At least on the Raspberry Zero W and CM3, we need to pass uart_2ndstage=1, so the BootROM leaves the 8250 IP in a suitable state for use by barebox. Document this.
[1]: https://www.raspberrypi.org/documentation/configuration/uart.md
--- Documentation/boards/bcm2835.rst | 7 +++++++ 1 file changed, 7 insertions(+)
Documentation/boards/bcm2835.rst +7 -0
@@ -23,6 +23,13 @@ Raspberry Pi kernel=barebox.img enable_uart=1 + If you want to use the mini-uart instead of the PL011, you might need to additionally set:: + + uart_2ndstage=1 + + This is useful on newer boards like the Raspberry Pi Zero W and CM3, which route the + more easily accessible primary UART to the mini-uart. + (For more information, refer to the `documentation for config.txt`_.) 5. Connect to board's UART (115200 8N1);
Signature · 7 lines
2.28.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 11/11] doc: bcm283x: document use of mini-uart on Raspberry Pi Zero W / CM3
Quoted 23 lines · Ahmad Fatoum
As described in the UART configuration[1] article in the Raspberry Pi Foundation documentation, Raspberry Pi 3 & 4 as well as Zero W use the mini-uart as primary (easily user-accessible) UART. At least on the Raspberry Zero W and CM3, we need to pass uart_2ndstage=1, so the BootROM leaves the 8250 IP in a suitable state for use by barebox. Document this.
[1]: https://www.raspberrypi.org/documentation/configuration/uart.md
Cc Roland Hieber <[email protected]>Cc Rouven Czerwinski <[email protected]>Cc Robert Carnecky <[email protected]>Cc Andrew John <[email protected]>Signed-off-by Ahmad Fatoum <[email protected]>--- Documentation/boards/bcm2835.rst | 7 +++++++ 1 file changed, 7 insertions(+)Documentation/boards/bcm2835.rst +0
-0
Documentation/boards/bcm2835.rst Raspberry Pi · line 31
Quoted 9 lines
Documentation/boards/bcm2835.rst +6
-0@@ -23,6 +23,13 @@ Raspberry Pi kernel=barebox.img enable_uart=1 + If you want to use the mini-uart instead of the PL011, you might need to additionally set:: + + uart_2ndstage=1 + + This is useful on newer boards like the Raspberry Pi Zero W and CM3, which route the + more easily accessible primary UART to the mini-uart.
This seems to be non-optional on RPi Zero W, so I would word it more strongly.
With this series, at least barebox boots, which is better than in master :-) However, I cannot get the stock kernel (/boot/kernel.img) to boot on Zero W, and I cannot figure out why:
barebox@RaspberryPi Zero W:/ cat /boot/config.txt
enable_uart=1
kernel=barebox.img
uart_2ndstage=1
barebox@RaspberryPi Zero W:/ global bootm.image=/boot/kernel.img
barebox@RaspberryPi Zero W:/ global bootm.oftree=/boot/bcm2708-rpi-0-w.dtb barebox@RaspberryPi Zero W:/ global linux.bootargs.dyn.root="root=/dev/mmcblk0p2 rootfstype=ext4 rootwait rw" barebox@RaspberryPi Zero W:/ bootm -v
Loading ARM Linux zImage '/boot/kernel.img'
OS image not yet relocated
Passing control to ARM zImage handler
no OS load address, defaulting to 0x014e9000
no initrd load address, defaulting to 0x01a18000
Loading devicetree from '/boot/bcm2708-rpi-0-w.dtb'
commandline: console=ttyS1,115200n8 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait rw
Starting kernel at 0x014e9000, oftree at 0x01a18000... Starting kernel in secure mode
and then nothing happens at least for a minute.
I tried leaving 'uart_2ndstage=1' out, leaving 'enable_uart=1' out, setting 'console=ttyS1,115200n8' on the kernel command line, and setting 'console=ttyAMA0,115200n8' (as before), but nothing helped.
The same setup works on a RPI-1B (with bootm.oftree=/boot/bcm2708-rpi-b.dtb), so at least there's that :)
Did you do anything else for your Zero W?
- Roland
Quoted 8 lines
Documentation/boards/bcm2835.rst +1
-0+ (For more information, refer to the `documentation for config.txt`_.) 5. Connect to board's UART (115200 8N1);Signature · 1 line
2.28.0
Signature · 9 lines
Roland Hieber, Pengutronix e.K. | [email protected] | Steuerwalder Str. 21 | https://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 11/11] doc: bcm283x: document use of mini-uart on Raspberry Pi Zero W / CM3
Hello,
Quoted 63 lines · Roland Hieber
Quoted 23 lines · Ahmad Fatoum
As described in the UART configuration[1] article in the Raspberry Pi Foundation documentation, Raspberry Pi 3 & 4 as well as Zero W use the mini-uart as primary (easily user-accessible) UART. At least on the Raspberry Zero W and CM3, we need to pass uart_2ndstage=1, so the BootROM leaves the 8250 IP in a suitable state for use by barebox. Document this.
[1]: https://www.raspberrypi.org/documentation/configuration/uart.md
Cc Roland Hieber <[email protected]>Cc Rouven Czerwinski <[email protected]>Cc Robert Carnecky <[email protected]>Cc Andrew John <[email protected]>Signed-off-by Ahmad Fatoum <[email protected]>--- Documentation/boards/bcm2835.rst | 7 +++++++ 1 file changed, 7 insertions(+)Documentation/boards/bcm2835.rst +0
-0Documentation/boards/bcm2835.rst Raspberry Pi · line 31
Quoted 9 lines
Documentation/boards/bcm2835.rst +6
-0@@ -23,6 +23,13 @@ Raspberry Pi kernel=barebox.img enable_uart=1 + If you want to use the mini-uart instead of the PL011, you might need to additionally set:: + + uart_2ndstage=1 + + This is useful on newer boards like the Raspberry Pi Zero W and CM3, which route the + more easily accessible primary UART to the mini-uart.This seems to be non-optional on RPi Zero W, so I would word it more strongly.
With this series, at least barebox boots, which is better than in master :-) However, I cannot get the stock kernel (
/boot/kernel.img) to boot on Zero W, and I cannot figure out why:barebox@RaspberryPi Zero W:/ cat
/boot/config.txt
enable_uart=1
kernel=barebox.img
uart_2ndstage=1
barebox@RaspberryPi Zero W:/ global bootm.image=/boot/kernel.img
barebox@RaspberryPi Zero W:/ global bootm.oftree=/boot/bcm2708-rpi-0-w.dtb barebox@RaspberryPi Zero W:/ global linux.bootargs.dyn.root="root=/dev/mmcblk0p2 rootfstype=ext4 rootwait rw" barebox@RaspberryPi Zero W:/ bootm -vLoading ARM Linux zImage '
/boot/kernel.img'
OS image not yet relocated
Passing control to ARM zImage handler
no OS load address, defaulting to0x014e9000
no initrd load address, defaulting to0x01a18000
Loading devicetree from '/boot/bcm2708-rpi-0-w.dtb'
commandline: console=ttyS1,115200n8 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait rwStarting kernel at
0x014e9000, oftree at0x01a18000... Starting kernel in secure modeand then nothing happens at least for a minute.
Quoted 8 lines
I tried leaving 'uart_2ndstage=1' out, leaving 'enable_uart=1' out, setting 'console=ttyS1,115200n8' on the kernel command line, and setting 'console=ttyAMA0,115200n8' (as before), but nothing helped.
The same setup works on a RPI-1B (with bootm.oftree=/boot/bcm2708-rpi-b.dtb), so at least there's that :)
Did you do anything else for your Zero W?
Can you try boot rpi instead?
Quoted 12 lines
- Roland
Quoted 8 lines
Documentation/boards/bcm2835.rst +1
-0+ (For more information, refer to the `documentation for config.txt`_.) 5. Connect to board's UART (115200 8N1);Signature · 1 line
2.28.0
Signature · 9 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 11/11] doc: bcm283x: document use of mini-uart on Raspberry Pi Zero W / CM3
In reply to Roland HieberQuoted 37 lines · Roland Hieber
Quoted 23 lines · Ahmad Fatoum
As described in the UART configuration[1] article in the Raspberry Pi Foundation documentation, Raspberry Pi 3 & 4 as well as Zero W use the mini-uart as primary (easily user-accessible) UART. At least on the Raspberry Zero W and CM3, we need to pass uart_2ndstage=1, so the BootROM leaves the 8250 IP in a suitable state for use by barebox. Document this.
[1]: https://www.raspberrypi.org/documentation/configuration/uart.md
Cc Roland Hieber <[email protected]>Cc Rouven Czerwinski <[email protected]>Cc Robert Carnecky <[email protected]>Cc Andrew John <[email protected]>Signed-off-by Ahmad Fatoum <[email protected]>--- Documentation/boards/bcm2835.rst | 7 +++++++ 1 file changed, 7 insertions(+)Documentation/boards/bcm2835.rst +0
-0Documentation/boards/bcm2835.rst Raspberry Pi · line 31
Quoted 9 lines
Documentation/boards/bcm2835.rst +6
-0@@ -23,6 +23,13 @@ Raspberry Pi kernel=barebox.img enable_uart=1 + If you want to use the mini-uart instead of the PL011, you might need to additionally set:: + + uart_2ndstage=1 + + This is useful on newer boards like the Raspberry Pi Zero W and CM3, which route the + more easily accessible primary UART to the mini-uart.This seems to be non-optional on RPi Zero W, so I would word it more strongly.
Quoted 3 lines
With this series, at least barebox boots, which is better than in master :-) However, I cannot get the stock kernel (
/boot/kernel.img) to boot on Zero W, and I cannot figure out why:
Should I wait for this being fixed before I merge this series?
Sascha
Signature · 9 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 11/11] doc: bcm283x: document use of mini-uart on Raspberry Pi Zero W / CM3
Quoted 47 lines · Sascha Hauer
Quoted 46 lines · Roland Hieber
Quoted 38 lines · Ahmad Fatoum
As described in the UART configuration[1] article in the Raspberry Pi
Foundation documentation, Raspberry Pi 3 & 4 as well as Zero W use the
mini-uart as primary (easily user-accessible) UART. At least on the
Raspberry Zero W and CM3, we need to pass uart_2ndstage=1, so the BootROM leaves the 8250 IP in a suitable state for use by barebox.
Document this.[1]:
https://www.raspberrypi.org/documentation/configuration/uart.mdCc Roland Hieber <[email protected]>Cc Rouven Czerwinski <[email protected]>Cc Robert Carnecky <[email protected]>Cc Andrew John <[email protected]>Signed-off-by Ahmad Fatoum <[email protected]>--- Documentation/boards/bcm2835.rst | 7 +++++++ 1 file changed, 7 insertions(+)Documentation/boards/bcm2835.rst +1
-0@@ -23,6 +23,13 @@ Raspberry Pi kernel=barebox.img enable_uart=1 + If you want to use the mini-uart instead of the PL011, youmight need to additionally set::
Documentation/boards/bcm2835.rst +4
-0+ + uart_2ndstage=1 + + This is useful on newer boards like the Raspberry Pi Zero WQuoted 2 lines
and CM3, which route the
+ more easily accessible primary UART to the mini-uart.This seems to be non-optional on RPi Zero W, so I would word it more
strongly.
Quoted 7 lines
Quoted 5 lines
With this series, at least barebox boots, which is better than in master
:-) However, I cannot get the stock kernel (/boot/kernel.img) to boot on
Zero W, and I cannot figure out why:Should I wait for this being fixed before I merge this series?
I sent a fixup. I think it's ok to merge that way.
Quoted 3 lines
Sascha
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 11/11] doc: bcm283x: document use of mini-uart on Raspberry Pi Zero W / CM3
Quoted 54 lines · Ahmad Fatoum
Quoted 53 lines · Sascha Hauer
Quoted 51 lines · Roland Hieber
Quoted 38 lines · Ahmad Fatoum
As described in the UART configuration[1] article in the Raspberry Pi
Foundation documentation, Raspberry Pi 3 & 4 as well as Zero W use the
mini-uart as primary (easily user-accessible) UART. At least on the
Raspberry Zero W and CM3, we need to pass uart_2ndstage=1, so the BootROM leaves the 8250 IP in a suitable state for use by barebox.
Document this.[1]:
https://www.raspberrypi.org/documentation/configuration/uart.mdCc Roland Hieber <[email protected]>Cc Rouven Czerwinski <[email protected]>Cc Robert Carnecky <[email protected]>Cc Andrew John <[email protected]>Signed-off-by Ahmad Fatoum <[email protected]>--- Documentation/boards/bcm2835.rst | 7 +++++++ 1 file changed, 7 insertions(+)Documentation/boards/bcm2835.rst +1
-0@@ -23,6 +23,13 @@ Raspberry Pi kernel=barebox.img enable_uart=1 + If you want to use the mini-uart instead of the PL011, youmight need to additionally set::
Documentation/boards/bcm2835.rst +4
-0+ + uart_2ndstage=1 + + This is useful on newer boards like the Raspberry Pi Zero WQuoted 2 lines
and CM3, which route the
+ more easily accessible primary UART to the mini-uart.This seems to be non-optional on RPi Zero W, so I would word it more
strongly.With this series, at least barebox boots, which is better than in master
:-) However, I cannot get the stock kernel (/boot/kernel.img) to boot on
Zero W, and I cannot figure out why:
Quoted 3 lines
Quoted 1 line
Should I wait for this being fixed before I merge this series?
I sent a fixup. I think it's ok to merge that way.
Ok, did that.
Sascha
Signature · 9 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 1/1 fixup! doc: bcm283x: document use of mini-uart on Raspberry Pi Zero W / CM3
In reply to Ahmad Fatoum--- Documentation/boards/bcm2835.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Documentation/boards/bcm2835.rst +3 -3
@@ -23,12 +23,12 @@ Raspberry Pi kernel=barebox.img enable_uart=1 - If you want to use the mini-uart instead of the PL011, you might need to additionally set:: + If you want to use the mini-uart instead of the PL011, you may need to additionally set:: uart_2ndstage=1 - This is useful on newer boards like the Raspberry Pi Zero W and CM3, which route the - more easily accessible primary UART to the mini-uart. + This is required on boards, like the Raspberry Pi Zero W, that use the mini-uart as the + primary UART. It is needed on boards like the CM3 as well if the mini-uart is to be used. (For more information, refer to the `documentation for config.txt`_.)
Signature · 7 lines
2.28.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox