[U-Boot] [PATCH 1/2] arm: add support for LaCie CloudBox

Simon Guinot simon.guinot at sequanux.org
Tue Jun 25 23:09:28 CEST 2013


On Tue, Jun 25, 2013 at 10:50:56PM +0200, Simon Guinot wrote:
> On Tue, Jun 25, 2013 at 06:49:04PM +0200, Frederic Leroy wrote:
> > From: Frédéric Leroy <fredo at starox.org>
> 
> Hi Frédéric,
> 
> > 
> > The LaCie CloudBox device is a Kirkwood based nas :
> > 
> > - SoC: Marvell 88F6700 1000Mhz
> 
> 88F6702
> 
> > - SDRAM memory: 256MB DDR2 400Mhz
> > - Gigabit ethernet: PHY Marvell 88E1318
> > - Flash memory: SPI NOR 512KB (Macronix MX25L4005A)
> > - 1 push button
> > - 1 reset switch
> > - 1 SATA port
> > - 1 LED (bi-color, blue and red)
> > 
> > Signed-off-by: Frédéric Leroy <fredo at starox.org>
> > ---
> >  board/LaCie/cloudbox/Makefile     |  46 +++++++++++
> >  board/LaCie/cloudbox/cloudbox.c   | 104 ++++++++++++++++++++++++
> >  board/LaCie/cloudbox/cloudbox.h   |  36 ++++++++
> >  board/LaCie/cloudbox/kwbimage.cfg | 167 ++++++++++++++++++++++++++++++++++++++
> >  boards.cfg                        |   1 +
> >  include/configs/lacie_kw.h        |   8 +-
> >  6 files changed, 361 insertions(+), 1 deletion(-)
> >  create mode 100644 board/LaCie/cloudbox/Makefile
> >  create mode 100644 board/LaCie/cloudbox/cloudbox.c
> >  create mode 100644 board/LaCie/cloudbox/cloudbox.h
> >  create mode 100644 board/LaCie/cloudbox/kwbimage.cfg
> > 
> > diff --git a/board/LaCie/cloudbox/Makefile b/board/LaCie/cloudbox/Makefile
> > new file mode 100644
> > index 0000000..d656951
> > --- /dev/null
> > +++ b/board/LaCie/cloudbox/Makefile
> > @@ -0,0 +1,46 @@
> > +#
> > +# Copyright (C) 2013 Frederic Leroy <fredo at starox.org>
> > +#
> > +# Based on Kirkwood support:
> > +# (C) Copyright 2009
> > +# Marvell Semiconductor <www.marvell.com>
> > +# Written-by: Prafulla Wadaskar <prafulla at marvell.com>
> > +#
> > +# See file CREDITS for list of people who contributed to this
> > +# project.
> > +#
> > +# This program is free software; you can redistribute it and/or
> > +# modify it under the terms of the GNU General Public License as
> > +# published by the Free Software Foundation; either version 2 of
> > +# the License, or (at your option) any later version.
> > +#
> > +# This program is distributed in the hope that it will be useful,
> > +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
> > +# GNU General Public License for more details.
> > +#
> > +
> > +include $(TOPDIR)/config.mk
> > +ifneq ($(OBJTREE),$(SRCTREE))
> > +$(shell mkdir -p $(obj)../common)
> > +endif
> > +
> > +LIB	= $(obj)lib$(BOARD).o
> > +
> > +COBJS	:= $(BOARD).o ../common/common.o
> > +
> > +SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
> > +OBJS	:= $(addprefix $(obj),$(COBJS))
> > +SOBJS	:= $(addprefix $(obj),$(SOBJS))
> > +
> > +$(LIB):	$(obj).depend $(OBJS) $(SOBJS)
> > +	$(call cmd_link_o_target, $(OBJS) $(SOBJS))
> > +
> > +#########################################################################
> > +
> > +# defines $(obj).depend target
> > +include $(SRCTREE)/rules.mk
> > +
> > +sinclude $(obj).depend
> > +
> > +#########################################################################
> > diff --git a/board/LaCie/cloudbox/cloudbox.c b/board/LaCie/cloudbox/cloudbox.c
> > new file mode 100644
> > index 0000000..6604a3c
> > --- /dev/null
> > +++ b/board/LaCie/cloudbox/cloudbox.c
> > @@ -0,0 +1,104 @@
> > +/*
> > + * Copyright (C) 2013 Frederic Leroy <fredo at starox.org>
> > + *
> > + * Based on Kirkwood support:
> > + * (C) Copyright 2009
> > + * Marvell Semiconductor <www.marvell.com>
> > + * Written-by: Prafulla Wadaskar <prafulla at marvell.com>
> > + *
> > + * See file CREDITS for list of people who contributed to this
> > + * project.
> > + *
> > + * This program is free software; you can redistribute it and/or
> > + * modify it under the terms of the GNU General Public License as
> > + * published by the Free Software Foundation; either version 2 of
> > + * the License, or (at your option) any later version.
> > + *
> > + * This program is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> > + * GNU General Public License for more details.
> > + */
> > +
> > +#include <common.h>
> > +#include <command.h>
> > +#include <asm/arch/cpu.h>
> > +#include <asm/arch/kirkwood.h>
> > +#include <asm/arch/mpp.h>
> > +#include <asm/arch/gpio.h>
> > +
> > +#include "cloudbox.h"
> > +#include "../common/common.h"
> > +
> > +DECLARE_GLOBAL_DATA_PTR;
> > +
> > +int board_early_init_f(void)
> > +{
> > +	/* Gpio configuration */
> > +	kw_config_gpio(CLOUDBOX_OE_VAL_LOW, CLOUDBOX_OE_VAL_HIGH,
> > +			CLOUDBOX_OE_LOW, CLOUDBOX_OE_HIGH);
> > +
> > +	/* Multi-Purpose Pins Functionality configuration */
> > +	static const u32 kwmpp_config[] = {
> > +		MPP0_SPI_SCn,
> > +		MPP1_SPI_MOSI,
> > +		MPP2_SPI_SCK,
> > +		MPP3_SPI_MISO,
> > +		MPP4_GPIO, /* hard disk power */
> > +		MPP5_GPO,
> > +		MPP6_SYSRST_OUTn,
> > +		MPP7_GPO,
> > +		MPP8_TW_SDA,
> > +		MPP9_TW_SCK,
> > +		MPP10_UART0_TXD,
> > +		MPP11_UART0_RXD,
> > +		MPP12_GPO,
> > +		MPP14_GPIO, /* LED red control */
> > +		MPP15_SATA0_ACTn, /* LED blue control */
> > +		MPP16_GPIO, /* power push buton */
> > +		MPP17_GPIO, /* board power off */
> > +		MPP20_GPIO, /* Ethernet PHY interrupt (WoL) */
> > +		MPP28_GPIO, /* board revision (LSB) */
> > +		MPP29_GPIO, /* board revision */
> > +		MPP30_GPIO, /* board revision */
> > +		MPP31_GPIO, /* board revision */
> > +		MPP32_GPIO, /* board revision (MSB) */
> > +		0
> 
> The MPPs 5, 7 and 12 are not used. Please drop their configuration.
> 
> Moreover, AFAIK, the board revision GPIOs are not used. I am not even
> sure they hold a coherent value.
> 
> > +	};
> > +	kirkwood_mpp_conf(kwmpp_config, NULL);
> > +
> > +	return 0;
> > +}
> > +
> > +int board_init(void)
> > +{
> > +	/* Nothing to do with fdt */
> > +	return 0;
> 
> In addition, can we also set the machine ID ? Without breaking the DT
> boot ? It would be nice to support the two Linux booting methods: DT
> and legacy (machine ID, ATAGs). Note that the Linux kernel provided by
> the LaCie stock firmware is not DT compliant.
> 
> > +}
> > +
> > +#if defined(CONFIG_MISC_INIT_R)
> > +int misc_init_r(void)
> > +{
> > +       return 0;
> > +}
> > +#endif /* CONFIG_MISC_INIT_R */
> 
> Maybe you could simply undef CONFIG_MISC_INIT_R ?
> 
> Except the points above, the whole patch looks good to me.

In addition, you should also fix the checkpatch warnings.

Simon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130625/2798c7e7/attachment.pgp>


More information about the U-Boot mailing list