raspberry-pi: updates
Subsystems (5)
v2 cover raspberry-pi: updates
Hi,
v2:
send correct leds patch
The following patch serie prepare the raspberry for USB support
The following changes since commit 9cd14d260aa22ae089f81a07be2c0e5dea2ffc94:
Merge branch 'for-next/pbl-console' (2015-01-09 17:38:27 +0100)
are available in the git repository at:
git://git.jcrosoft.org/barebox.git delivery/rpi
for you to fetch changes up to 70d2d564af770d99c0e8a4fbfa314e6d55d58629:
regulator: add bcm2835 driver (2015-01-11 19:04:06 +0800)
----------------------------------------------------------------
Jean-Christophe PLAGNIOL-VILLARD (6):
raspberry-pi: add board model detection
raspberry-pi: add leds support
amba: pl011: add support for regulator
driver: add postcore_platform_driver
regulator: allow to use it with non DT device
regulator: add bcm2835 driver
arch/arm/boards/raspberry-pi/env/init/ps1 | 7 +++++++ arch/arm/boards/raspberry-pi/rpi.c | 138 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- arch/arm/mach-bcm2835/include/mach/mbox.h | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ drivers/regulator/Kconfig | 7 ++++++- drivers/regulator/Makefile | 1 + drivers/regulator/bcm2835.c | 149 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ drivers/regulator/core.c | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------- drivers/serial/amba-pl011.c | 11 +++++++++++ include/driver.h | 2 ++ include/regulator.h | 10 ++++++++++ 10 files changed, 488 insertions(+), 18 deletions(-) create mode 100644 arch/arm/boards/raspberry-pi/env/init/ps1 create mode 100644 drivers/regulator/bcm2835.c
Best Regards,
J.
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
PATCH v2 2/6 raspberry-pi: add leds support
In reply to Jean-Christophe PLAGNIOL-VILLARD--- arch/arm/boards/raspberry-pi/rpi.c | 55 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+)
arch/arm/boards/raspberry-pi/rpi.c +55 -0
@@ -21,6 +21,8 @@#include <linux/clkdev.h> #include <envfs.h> #include <malloc.h> +#include <gpio.h> +#include <led.h> #include <asm/armlinux.h> #include <generated/mach-types.h>
@@ -87,6 +89,49 @@ static int rpi_register_clkdev(u32 clock_id, const char *name) } +static struct gpio_led leds[] = { + { + .gpio = -EINVAL , + .led = { + .name ="ACT" , + }, + }, { + .gpio = -EINVAL , + .led = { + .name ="PWR" , + }, + }, +}; + +static void rpi_add_led (void ) +{ +int i; +struct gpio_led *l; + +for (i =0 ; i <ARRAY_SIZE (leds); i++) { + l = &leds[i]; + +if (gpio_is_valid (l->gpio)) +led_gpio_register (l); + } + + l = &leds[0 ]; +if (gpio_is_valid (l->gpio)) +led_set_trigger (LED_TRIGGER_HEARTBEAT , &l->led); +} + +static void rpi_b_plus_init (void ) +{ + leds[0 ].gpio =47 ; + leds[1 ].gpio =35 ; +} + +static void rpi_b_init (void ) +{ + leds[0 ].gpio =16 ; + leds[0 ].active_low =1 ; +} +#define RPI_MODEL (_id, _name, _init) \ [_id] = { \ .name = _name,\
@@ -160,6 +205,15 @@ unknown_rev:barebox_set_model ("RaspberryPi (BCM2835/ARM1176JZF-S)" ); } +static void rpi_model_init (void ) +{ +if (!models[rpi_board_rev].init) +return ; + + models[rpi_board_rev].init (); +rpi_add_led (); +} +static int rpi_mem_init (void ) {u32 size =0 ;
@@ -220,6 +274,7 @@ static int rpi_env_init(void)static int rpi_devices_init (void ) { +rpi_model_init ();bcm2835_register_mci ();bcm2835_register_fb ();armlinux_set_architecture (MACH_TYPE_BCM2708 );
Signature · 7 lines
2.1.3 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v2 1/6 raspberry-pi: add board model detection
In reply to Jean-Christophe PLAGNIOL-VILLARDas the name is very long, return ps1 to the next line
--- arch/arm/boards/raspberry-pi/env/init/ps1 | 7 +++ arch/arm/boards/raspberry-pi/rpi.c | 83 ++++++++++++++++++++++++++++++- arch/arm/mach-bcm2835/include/mach/mbox.h | 34 +++++++++++++ 3 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 arch/arm/boards/raspberry-pi/env/init/ps1
arch/arm/boards/raspberry-pi/env/init/ps1 new file +7 -0
@@ -0,0 +1,7 @@ +#!/bin/sh + +if [ ${global.allow_color} = "true" ]; then + export PS1="\e[1;32mbarebox@\e[1;36m\h:\w\e[0m\n# " +else + export PS1="barebox@\h:\w\n# " +fi
arch/arm/boards/raspberry-pi/rpi.c +82 -1
107 lines not on this page · raw message
arch/arm/mach-bcm2835/include/mach/mbox.h +34 -0
@@ -124,6 +124,40 @@ struct bcm2835_mbox_tag_hdr {* }; */ +#define BCM2835_MBOX_TAG_GET_BOARD_REV 0x00010002 + +/* +* 0x2..0xf from: +* http://raspberryalphaomega.org.uk/2013/02/06/automatic-raspberry-pi-board-revision-detection-model-a-b1-and-b2/ +* http://www.raspberrypi.org/forums/viewtopic.php?f=63&t=32733 +* 0x10, 0x11 from swarren's testing +*/ +#define BCM2835_BOARD_REV_B_I2C0_2 0x2 +#define BCM2835_BOARD_REV_B_I2C0_3 0x3 +#define BCM2835_BOARD_REV_B_I2C1_4 0x4 +#define BCM2835_BOARD_REV_B_I2C1_5 0x5 +#define BCM2835_BOARD_REV_B_I2C1_6 0x6 +#define BCM2835_BOARD_REV_A_7 0x7 +#define BCM2835_BOARD_REV_A_8 0x8 +#define BCM2835_BOARD_REV_A_9 0x9 +#define BCM2835_BOARD_REV_B_REV2_d 0xd +#define BCM2835_BOARD_REV_B_REV2_e 0xe +#define BCM2835_BOARD_REV_B_REV2_f 0xf +#define BCM2835_BOARD_REV_B_PLUS 0x10 +#define BCM2835_BOARD_REV_CM 0x11 +#define BCM2835_BOARD_REV_A_PLUS 0x12 + +struct bcm2835_mbox_tag_get_board_rev { +struct bcm2835_mbox_tag_hdr tag_hdr; +union { +struct { + } req; +struct { +u32 rev; + } resp; + } body; +}; +#define BCM2835_MBOX_TAG_GET_ARM_MEMORY 0x00010005struct bcm2835_mbox_tag_get_arm_mem {
Signature · 7 lines
2.1.3 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v2 3/6 amba: pl011: add support for regulator
--- drivers/serial/amba-pl011.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/serial/amba-pl011.c +11 -0
@@ -28,6 +28,7 @@#include <init.h> #include <malloc.h> #include <io.h> +#include <regulator.h> #include <linux/amba/serial.h> #include <linux/clk.h> #include <linux/err.h>
@@ -181,6 +182,16 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id) {struct amba_uart_port *uart;struct console_device *cdev; +struct regulator *r; + + r =regulator_get (&dev->dev,NULL ); +if (r) { +int ret; + + ret =regulator_enable (r); +if (ret) +return ret; + } uart =xzalloc (sizeof (struct amba_uart_port )); uart->clk =clk_get (&dev->dev,NULL );
Signature · 7 lines
2.1.3 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v2 4/6 driver: add postcore_platform_driver
In reply to Jean-Christophe PLAGNIOL-VILLARD--- include/driver.h | 2 ++ 1 file changed, 2 insertions(+)
include/driver.h +2 -0
@@ -409,6 +409,8 @@ int platform_driver_register(struct driver_d *drv); } \ level##_initcall(drv##_register) +#define postcore_platform_driver (drv) \ + register_driver_macro(postcore,platform,drv)#define coredevice_platform_driver (drv) \ register_driver_macro(coredevice,platform,drv)#define device_platform_driver (drv) \
Signature · 7 lines
2.1.3 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v2 5/6 regulator: allow to use it with non DT device
In reply to Jean-Christophe PLAGNIOL-VILLARDthis will use the device name as regulator name
with the same Algo as clkdev for lookup
--- drivers/regulator/Kconfig | 2 +- drivers/regulator/core.c | 98 +++++++++++++++++++++++++++++++++++++++-------- include/regulator.h | 10 +++++ 3 files changed, 93 insertions(+), 17 deletions(-)
drivers/regulator/Kconfig +1 -1
@@ -1,5 +1,4 @@ menuconfig REGULATOR - depends on OFDEVICE bool "voltage regulator support" if REGULATOR
@@ -7,6 +6,7 @@ if REGULATOR config REGULATOR_FIXED bool "fixed/gpio regulator" depends on GENERIC_GPIO + depends on OFDEVICE help This enables a simple fixed regulator. It is used for regulators which are not software controllable or controllable via gpio.
drivers/regulator/core.c +82 -16
133 lines not on this page · raw message
include/regulator.h +10 -0
@@ -15,7 +15,17 @@ struct regulator_ops {int (*is_enabled) (struct regulator_dev *); }; +#ifdef CONFIG_OFDEVICE int of_regulator_register (struct regulator_dev *rd,struct device_node *node); +#else +static inline int of_regulator_register (struct regulator_dev *rd, +struct device_node *node) +{ +return -ENOSYS ; +} +#endif +int dev_regulator_register (struct regulator_dev *rd,const char * name, +const char * supply);void regulators_print (void );
Signature · 7 lines
2.1.3 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v2 6/6 regulator: add bcm2835 driver
In reply to Jean-Christophe PLAGNIOL-VILLARDthis will allow to handle IP power automatically and not at board level
Mainline kernel need this as they do not have the regulator driver support
as some IP such as USB are not power on at boot
--- arch/arm/mach-bcm2835/include/mach/mbox.h | 49 ++++++++++ drivers/regulator/Kconfig | 5 + drivers/regulator/Makefile | 1 + drivers/regulator/bcm2835.c | 149 ++++++++++++++++++++++++++++++ 4 files changed, 204 insertions(+) create mode 100644 drivers/regulator/bcm2835.c
arch/arm/mach-bcm2835/include/mach/mbox.h +49 -0
@@ -172,6 +172,55 @@ struct bcm2835_mbox_tag_get_arm_mem { } body; }; +#define BCM2835_MBOX_POWER_DEVID_SDHCI 0 +#define BCM2835_MBOX_POWER_DEVID_UART0 1 +#define BCM2835_MBOX_POWER_DEVID_UART1 2 +#define BCM2835_MBOX_POWER_DEVID_USB_HCD 3 +#define BCM2835_MBOX_POWER_DEVID_I2C0 4 +#define BCM2835_MBOX_POWER_DEVID_I2C1 5 +#define BCM2835_MBOX_POWER_DEVID_I2C2 6 +#define BCM2835_MBOX_POWER_DEVID_SPI 7 +#define BCM2835_MBOX_POWER_DEVID_CCP2TX 8 + +#define BCM2835_MBOX_POWER_STATE_RESP_ON (1 << 0) +/* Device doesn't exist */ +#define BCM2835_MBOX_POWER_STATE_RESP_NODEV (1 << 1) + +#define BCM2835_MBOX_TAG_GET_POWER_STATE 0x00020001 + +struct bcm2835_mbox_tag_get_power_state { +struct bcm2835_mbox_tag_hdr tag_hdr; +union { +struct { +u32 device_id; + } req; +struct { +u32 device_id; +u32 state; + } resp; + } body; +}; + +#define BCM2835_MBOX_TAG_SET_POWER_STATE 0x00028001 + +#define BCM2835_MBOX_SET_POWER_STATE_REQ_OFF (0 << 0) +#define BCM2835_MBOX_SET_POWER_STATE_REQ_ON (1 << 0) +#define BCM2835_MBOX_SET_POWER_STATE_REQ_WAIT (1 << 1) + +struct bcm2835_mbox_tag_set_power_state { +struct bcm2835_mbox_tag_hdr tag_hdr; +union { +struct { +u32 device_id; +u32 state; + } req; +struct { +u32 device_id; +u32 state; + } resp; + } body; +}; +#define BCM2835_MBOX_TAG_GET_CLOCK_RATE 0x00030002#define BCM2835_MBOX_CLOCK_ID_EMMC 1
drivers/regulator/Kconfig +5 -0
@@ -11,4 +11,9 @@ config REGULATOR_FIXED This enables a simple fixed regulator. It is used for regulators which are not software controllable or controllable via gpio. +config REGULATOR_BCM2835 + bool + depends on ARCH_BCM2835 + default y + endif
drivers/regulator/Makefile +1 -0
@@ -1,2 +1,3 @@ obj-$(CONFIG_REGULATOR) += core.o obj-$(CONFIG_REGULATOR_FIXED) += fixed.o +obj-$(CONFIG_REGULATOR_BCM2835) += bcm2835.o
drivers/regulator/bcm2835.c new file +149 -0
149 lines not on this page · raw message
Signature · 7 lines
2.1.3 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
AppliedQuoted 12 lines · Jean-Christophe PLAGNIOL-VILLARD
Hi,
v2:
send correct leds patch
The following patch serie prepare the raspberry for USB support
The following changes since commit
9cd14d260aa22ae089f81a07be2c0e5dea2ffc94:Merge branch 'for-next/pbl-console' (2015-01-09 17:38:27 +0100)
Quoted 7 lines
are available in the git repository at:
git://git.jcrosoft.org/barebox.gitdelivery/rpifor you to fetch changes up to
70d2d564af770d99c0e8a4fbfa314e6d55d58629:regulator: add bcm2835 driver (2015-01-11 19:04:06 +0800)
Applied, thanks
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 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 2/6] raspberry-pi: add leds support
In reply to Jean-Christophe PLAGNIOL-VILLARDQuoted 9 lines · On Tue, 13 Jan 2015 07:33:06 +0100 Jean-Christophe PLAGNIOL-VILLARD…
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>--- arch/arm/boards/raspberry-pi/rpi.c | 55 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+)arch/arm/boards/raspberry-pi/rpi.c +0
-0
...
arch/arm/boards/raspberry-pi/rpi.c unknown_rev: · line 211
Quoted 8 lines
arch/arm/boards/raspberry-pi/rpi.c +4
-0@@ -160,6 +205,15 @@ unknown_rev:barebox_set_model ("RaspberryPi (BCM2835/ARM1176JZF-S)" ); } +static void rpi_model_init (void ) +{ +if (!models[rpi_board_rev].init) +return ;
Houston, we have a problem here.
Please see current arch/arm/boards/raspberry-pi/rpi.c:
/* See comments in mbox.h for data source */
static const struct {
const char *name;
bool has_onboard_eth;
void (*init)(void);
} models[] = {
RPI_MODEL(0, "Unknown model", NULL),
RPI_MODEL(BCM2835_BOARD_REV_B_I2C0_2, "Model B (no P5)", NULL),
RPI_MODEL(BCM2835_BOARD_REV_B_I2C0_3, "Model B (no P5)", NULL),
RPI_MODEL(BCM2835_BOARD_REV_B_I2C1_4, "Model B", NULL),
RPI_MODEL(BCM2835_BOARD_REV_B_I2C1_5, "Model B", NULL),
RPI_MODEL(BCM2835_BOARD_REV_B_I2C1_6, "Model B", NULL),
RPI_MODEL(BCM2835_BOARD_REV_A_7, "Model A", NULL),
RPI_MODEL(BCM2835_BOARD_REV_A_8, "Model A", NULL),
RPI_MODEL(BCM2835_BOARD_REV_A_9, "Model A", NULL),
RPI_MODEL(BCM2835_BOARD_REV_B_REV2_d, "Model B rev2", NULL),
RPI_MODEL(BCM2835_BOARD_REV_B_REV2_e, "Model B rev2", NULL),
RPI_MODEL(BCM2835_BOARD_REV_B_REV2_f, "Model B rev2", NULL),
RPI_MODEL(BCM2835_BOARD_REV_B_PLUS, "Model B+", NULL),
RPI_MODEL(BCM2835_BOARD_REV_CM, "Compute Module", NULL),
RPI_MODEL(BCM2835_BOARD_REV_A_PLUS, "Model A+", NULL),
};All inits are NULLs!
Have we any chance to run rpi_add_led()?
Quoted 24 lines
arch/arm/boards/raspberry-pi/rpi.c +6
-0+ + models[rpi_board_rev].init (); +rpi_add_led (); +} +static int rpi_mem_init (void ) {u32 size =0 ;@@ -220,6 +274,7 @@ static int rpi_env_init(void)static int rpi_devices_init (void ) { +rpi_model_init ();bcm2835_register_mci ();bcm2835_register_fb ();armlinux_set_architecture (MACH_TYPE_BCM2708 );Signature · 7 lines
2.1.3 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Signature · 8 lines
-- Best regards, Antony Pavlov _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 5 lines · On Tue, 13 Jan 2015 07:31:28 +0100 Jean-Christophe PLAGNIOL-VILLARD…
Hi,
v2: send correct leds patch
IMHO we have to enable LED stuff in rpi_defconfig.
Quoted 44 lines
The following patch serie prepare the raspberry for USB support
The following changes since commit
9cd14d260aa22ae089f81a07be2c0e5dea2ffc94:Merge branch 'for-next/pbl-console' (2015-01-09 17:38:27 +0100)
are available in the git repository at:
git://git.jcrosoft.org/barebox.gitdelivery/rpifor you to fetch changes up to
70d2d564af770d99c0e8a4fbfa314e6d55d58629:regulator: add bcm2835 driver (2015-01-11 19:04:06 +0800)
----------------------------------------------------------------
Jean-Christophe PLAGNIOL-VILLARD (6):
raspberry-pi: add board model detection
raspberry-pi: add leds support
amba: pl011: add support for regulator
driver: addpostcore_platform_driver
regulator: allow to use it with non DT device
regulator: add bcm2835 driverarch/arm/boards/raspberry-pi/env/init/ps1 | 7 +++++++ arch/arm/boards/raspberry-pi/rpi.c | 138 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- arch/arm/mach-bcm2835/include/mach/mbox.h | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ drivers/regulator/Kconfig | 7 ++++++- drivers/regulator/Makefile | 1 + drivers/regulator/bcm2835.c | 149 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ drivers/regulator/core.c | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------- drivers/serial/amba-pl011.c | 11 +++++++++++ include/driver.h | 2 ++ include/regulator.h | 10 ++++++++++ 10 files changed, 488 insertions(+), 18 deletions(-) create mode 100644 arch/arm/boards/raspberry-pi/env/init/ps1 create mode 100644 drivers/regulator/bcm2835.cBest Regards,
J._______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 8 lines
-- Best regards, Antony Pavlov _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 2/6] raspberry-pi: add leds support
In reply to Antony PavlovQuoted 48 lines · Antony Pavlov
Quoted 9 lines · On Tue, 13 Jan 2015 07:33:06 +0100 Jean-Christophe PLAGNIOL-VILLARD…
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>--- arch/arm/boards/raspberry-pi/rpi.c | 55 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+)arch/arm/boards/raspberry-pi/rpi.c +0
-0...
arch/arm/boards/raspberry-pi/rpi.c unknown_rev: · line 211
Quoted 8 lines
arch/arm/boards/raspberry-pi/rpi.c +4
-0@@ -160,6 +205,15 @@ unknown_rev:barebox_set_model ("RaspberryPi (BCM2835/ARM1176JZF-S)" ); } +static void rpi_model_init (void ) +{ +if (!models[rpi_board_rev].init) +return ;Houston, we have a problem here.
Please see currentarch/arm/boards/raspberry-pi/rpi.c:/* See comments in
mbox.hfor data source */static const struct { const char *name; bool has_onboard_eth; void (*init)(void); } models[] = { RPI_MODEL(0, "Unknown model", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_I2C0_2, "Model B (no P5)", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_I2C0_3, "Model B (no P5)", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_I2C1_4, "Model B", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_I2C1_5, "Model B", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_I2C1_6, "Model B", NULL), RPI_MODEL(BCM2835_BOARD_REV_A_7, "Model A", NULL), RPI_MODEL(BCM2835_BOARD_REV_A_8, "Model A", NULL), RPI_MODEL(BCM2835_BOARD_REV_A_9, "Model A", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_REV2_d, "Model B rev2", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_REV2_e, "Model B rev2", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_REV2_f, "Model B rev2", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_PLUS, "Model B+", NULL), RPI_MODEL(BCM2835_BOARD_REV_CM, "Compute Module", NULL), RPI_MODEL(BCM2835_BOARD_REV_A_PLUS, "Model A+", NULL), };
Quoted 3 lines
All inits are NULLs!
Have we any chance to run
rpi_add_led()?
Hm, no, this is never called. Maybe rpi_model_init() should look like this instead?
static void rpi_model_init(void)
{
if (!models[rpi_board_rev].init)
models[rpi_board_rev].init();
rpi_add_led();
}But then again, why is rpi_add_led called from rpi_model_init()?
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 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 2/6] raspberry-pi: add leds support
Quoted 53 lines · On Mon, 19 Jan 2015 08:51:44 +0100 Sascha Hauer <[email protected]> wrote:
Quoted 48 lines · Antony Pavlov
Quoted 9 lines · On Tue, 13 Jan 2015 07:33:06 +0100 Jean-Christophe PLAGNIOL-VILLARD…
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>--- arch/arm/boards/raspberry-pi/rpi.c | 55 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+)arch/arm/boards/raspberry-pi/rpi.c +0
-0...
arch/arm/boards/raspberry-pi/rpi.c unknown_rev: · line 211
Quoted 8 lines
arch/arm/boards/raspberry-pi/rpi.c +4
-0@@ -160,6 +205,15 @@ unknown_rev:barebox_set_model ("RaspberryPi (BCM2835/ARM1176JZF-S)" ); } +static void rpi_model_init (void ) +{ +if (!models[rpi_board_rev].init) +return ;Houston, we have a problem here.
Please see currentarch/arm/boards/raspberry-pi/rpi.c:/* See comments in
mbox.hfor data source */static const struct { const char *name; bool has_onboard_eth; void (*init)(void); } models[] = { RPI_MODEL(0, "Unknown model", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_I2C0_2, "Model B (no P5)", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_I2C0_3, "Model B (no P5)", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_I2C1_4, "Model B", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_I2C1_5, "Model B", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_I2C1_6, "Model B", NULL), RPI_MODEL(BCM2835_BOARD_REV_A_7, "Model A", NULL), RPI_MODEL(BCM2835_BOARD_REV_A_8, "Model A", NULL), RPI_MODEL(BCM2835_BOARD_REV_A_9, "Model A", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_REV2_d, "Model B rev2", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_REV2_e, "Model B rev2", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_REV2_f, "Model B rev2", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_PLUS, "Model B+", NULL), RPI_MODEL(BCM2835_BOARD_REV_CM, "Compute Module", NULL), RPI_MODEL(BCM2835_BOARD_REV_A_PLUS, "Model A+", NULL), };Quoted 3 lines
All inits are NULLs!
Have we any chance to run
rpi_add_led()?
Quoted 7 lines
Hm, no, this is never called. Maybe
rpi_model_init()should look like this instead?static void
rpi_model_init(void){ if (!models[rpi_board_rev].init) models[rpi_board_rev].init();
Do you really want to dereference NULL pointer?
--
Best regards,
Antony Pavlov
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 2/6] raspberry-pi: add leds support
Quoted 59 lines · Antony Pavlov
Quoted 56 lines · On Mon, 19 Jan 2015 08:51:44 +0100 Sascha Hauer <[email protected]> wrote:
Quoted 48 lines · Antony Pavlov
Quoted 9 lines · On Tue, 13 Jan 2015 07:33:06 +0100 Jean-Christophe PLAGNIOL-VILLARD…
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>--- arch/arm/boards/raspberry-pi/rpi.c | 55 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+)arch/arm/boards/raspberry-pi/rpi.c +0
-0...
arch/arm/boards/raspberry-pi/rpi.c unknown_rev: · line 211
Quoted 8 lines
arch/arm/boards/raspberry-pi/rpi.c +4
-0@@ -160,6 +205,15 @@ unknown_rev:barebox_set_model ("RaspberryPi (BCM2835/ARM1176JZF-S)" ); } +static void rpi_model_init (void ) +{ +if (!models[rpi_board_rev].init) +return ;Houston, we have a problem here.
Please see currentarch/arm/boards/raspberry-pi/rpi.c:/* See comments in
mbox.hfor data source */static const struct { const char *name; bool has_onboard_eth; void (*init)(void); } models[] = { RPI_MODEL(0, "Unknown model", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_I2C0_2, "Model B (no P5)", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_I2C0_3, "Model B (no P5)", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_I2C1_4, "Model B", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_I2C1_5, "Model B", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_I2C1_6, "Model B", NULL), RPI_MODEL(BCM2835_BOARD_REV_A_7, "Model A", NULL), RPI_MODEL(BCM2835_BOARD_REV_A_8, "Model A", NULL), RPI_MODEL(BCM2835_BOARD_REV_A_9, "Model A", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_REV2_d, "Model B rev2", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_REV2_e, "Model B rev2", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_REV2_f, "Model B rev2", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_PLUS, "Model B+", NULL), RPI_MODEL(BCM2835_BOARD_REV_CM, "Compute Module", NULL), RPI_MODEL(BCM2835_BOARD_REV_A_PLUS, "Model A+", NULL), };Quoted 3 lines
All inits are NULLs!
Have we any chance to run
rpi_add_led()?Hm, no, this is never called. Maybe
rpi_model_init()should look like this instead?
Quoted 7 lines
Quoted 4 lines
static void
rpi_model_init(void){ if (!models[rpi_board_rev].init) models[rpi_board_rev].init();Do you really want to dereference NULL pointer?
Nah, drop the '!' of course.
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 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 2/6] raspberry-pi: add leds support
In reply to Antony PavlovQuoted 48 lines · Antony Pavlov
Quoted 9 lines · On Tue, 13 Jan 2015 07:33:06 +0100 Jean-Christophe PLAGNIOL-VILLARD…
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>--- arch/arm/boards/raspberry-pi/rpi.c | 55 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+)arch/arm/boards/raspberry-pi/rpi.c +0
-0...
arch/arm/boards/raspberry-pi/rpi.c unknown_rev: · line 211
Quoted 8 lines
arch/arm/boards/raspberry-pi/rpi.c +4
-0@@ -160,6 +205,15 @@ unknown_rev:barebox_set_model ("RaspberryPi (BCM2835/ARM1176JZF-S)" ); } +static void rpi_model_init (void ) +{ +if (!models[rpi_board_rev].init) +return ;Houston, we have a problem here.
Please see currentarch/arm/boards/raspberry-pi/rpi.c:/* See comments in
mbox.hfor data source */static const struct { const char *name; bool has_onboard_eth; void (*init)(void); } models[] = { RPI_MODEL(0, "Unknown model", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_I2C0_2, "Model B (no P5)", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_I2C0_3, "Model B (no P5)", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_I2C1_4, "Model B", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_I2C1_5, "Model B", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_I2C1_6, "Model B", NULL), RPI_MODEL(BCM2835_BOARD_REV_A_7, "Model A", NULL), RPI_MODEL(BCM2835_BOARD_REV_A_8, "Model A", NULL), RPI_MODEL(BCM2835_BOARD_REV_A_9, "Model A", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_REV2_d, "Model B rev2", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_REV2_e, "Model B rev2", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_REV2_f, "Model B rev2", NULL), RPI_MODEL(BCM2835_BOARD_REV_B_PLUS, "Model B+", NULL), RPI_MODEL(BCM2835_BOARD_REV_CM, "Compute Module", NULL), RPI_MODEL(BCM2835_BOARD_REV_A_PLUS, "Model A+", NULL), };
Quoted 3 lines
All inits are NULLs!
Have we any chance to run
rpi_add_led()?
there is a missing patch
that add the usb support
so the init is not NULL
so I'll send a fixup for now on
that move the rpi_add_led to the init pointer
Best Regards,
J.
Quoted 22 lines
Quoted 22 lines
arch/arm/boards/raspberry-pi/rpi.c +6
-0+ + models[rpi_board_rev].init (); +rpi_add_led (); +} +static int rpi_mem_init (void ) {u32 size =0 ;@@ -220,6 +274,7 @@ static int rpi_env_init(void)static int rpi_devices_init (void ) { +rpi_model_init ();bcm2835_register_mci ();bcm2835_register_fb ();armlinux_set_architecture (MACH_TYPE_BCM2708 );Signature · 1 line
2.1.3
Quoted 10 lines
Quoted 4 lines
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/bareboxSignature · 3 lines
-- Best regards, Antony Pavlov
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox