[PATCH 2/6] raspberry-pi: add leds support

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Mon Jan 19 04:16:04 PST 2015


On 02:08 Mon 19 Jan     , Antony Pavlov wrote:
> On Tue, 13 Jan 2015 07:33:06 +0100
> Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com> wrote:
> 
> > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
> > ---
> >  arch/arm/boards/raspberry-pi/rpi.c | 55 ++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 55 insertions(+)
> > 
> > diff --git a/arch/arm/boards/raspberry-pi/rpi.c b/arch/arm/boards/raspberry-pi/rpi.c
> > index ae1e92a..81b485e 100644
> > --- a/arch/arm/boards/raspberry-pi/rpi.c
> > +++ b/arch/arm/boards/raspberry-pi/rpi.c
> ...
> > @@ -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()?

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.
> 
> 
> > +
> > +	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);
> > -- 
> > 2.1.3
> > 
> > 
> > _______________________________________________
> > barebox mailing list
> > barebox at lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/barebox
> 
> 
> -- 
> -- 
> Best regards,
>   Antony Pavlov



More information about the barebox mailing list