public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Simon Guinot <simon.guinot@sequanux.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] arm: add support for LaCie CloudBox
Date: Tue, 25 Jun 2013 22:50:56 +0200	[thread overview]
Message-ID: <20130625205056.GE7626@kw.sim.vm.gnt> (raw)
In-Reply-To: <1372178945-11528-2-git-send-email-fredo@starox.org>

On Tue, Jun 25, 2013 at 06:49:04PM +0200, Frederic Leroy wrote:
> From: Fr?d?ric Leroy <fredo@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@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@starox.org>
> +#
> +# Based on Kirkwood support:
> +# (C) Copyright 2009
> +# Marvell Semiconductor <www.marvell.com>
> +# Written-by: Prafulla Wadaskar <prafulla@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@starox.org>
> + *
> + * Based on Kirkwood support:
> + * (C) Copyright 2009
> + * Marvell Semiconductor <www.marvell.com>
> + * Written-by: Prafulla Wadaskar <prafulla@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.

Thanks,

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/fbca2899/attachment.pgp>

  parent reply	other threads:[~2013-06-25 20:50 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-25 16:49 [U-Boot] [PATCH 0/2] add support for LaCie CloudBox Frederic Leroy
2013-06-25 16:49 ` [U-Boot] [PATCH 1/2] arm: " Frederic Leroy
2013-06-25 18:24   ` Wolfgang Denk
2013-06-30 10:12     ` [U-Boot] [PATCH v2 0/4] " Frédéric Leroy
2013-06-30 10:12       ` [U-Boot] [PATCH v2 1/4] lacie_kw: sort #ifdef lists by CONFIG_ identifiers Frédéric Leroy
2013-06-30 22:15         ` Simon Guinot
2013-06-30 10:12       ` [U-Boot] [PATCH v2 2/4] arm: add support for LaCie CloudBox Frédéric Leroy
2013-06-30 10:12       ` [U-Boot] [PATCH v2 3/4] LaCie/common: Fix cloudbox ethernet leds Frédéric Leroy
2013-06-30 23:01         ` Simon Guinot
2013-07-01  9:51           ` [U-Boot] compiled failed when turned off gcc optimazition TigerLiu at viatech.com.cn
2013-07-01 10:03             ` Wolfgang Denk
2013-07-01 10:08               ` TigerLiu at viatech.com.cn
2013-07-01 11:37                 ` Wolfgang Denk
2013-07-01 18:03                   ` Mike Dunn
2013-07-01 19:51                     ` Wolfgang Denk
2013-07-02 19:40                       ` Mike Dunn
2013-07-02 22:38                         ` Graeme Russ
2013-07-05 10:31                           ` TigerLiu at viatech.com.cn
2013-07-05 14:00                             ` [U-Boot] compiled failed when turned off gcc optimazitionAT Albert ARIBAUD
2013-06-30 10:12       ` [U-Boot] [PATCH v2 4/4] arm: add machine ID for CloudBox Frédéric Leroy
2013-06-30 22:53         ` Simon Guinot
2013-07-01  9:30           ` Frédéric Leroy
2013-07-01 10:01             ` Simon Guinot
2013-06-25 20:50   ` Simon Guinot [this message]
2013-06-25 21:09     ` [U-Boot] [PATCH 1/2] arm: add support for LaCie CloudBox Simon Guinot
2013-06-25 16:49 ` [U-Boot] [PATCH 2/2] LaCie/common: Fix cloudbox ethernet leds Frederic Leroy
2013-06-25 18:27   ` Wolfgang Denk
2013-06-25 21:08   ` Simon Guinot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130625205056.GE7626@kw.sim.vm.gnt \
    --to=simon.guinot@sequanux.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox