All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Guinot <simon.guinot@sequanux.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/2] ARM: lacie_kw: add support for WIRELESS_SPACE
Date: Sat, 20 Oct 2012 02:17:23 +0200	[thread overview]
Message-ID: <20121020001723.GI28384@kw.sim.vm.gnt> (raw)
In-Reply-To: <1350682689-2986-2-git-send-email-albert.u.boot@aribaud.net>

On Fri, Oct 19, 2012 at 11:38:09PM +0200, Albert ARIBAUD wrote:
> Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
> ---
> Changes in v2:
> - split the patch in two: mvgbe phy/port changes and WS support.
> - removed spurious DEBUG define
> - fixed various checkpatch errors/warnings/typos
> 
>  board/LaCie/netspace_v2/netspace_v2.c |   44 ++----------
>  board/LaCie/netspace_v2/netspace_v2.h |  121 +++++++++++++++++++++++++++++++++
>  boards.cfg                            |    1 +
>  include/configs/lacie_kw.h            |   42 +++++++++++-
>  4 files changed, 168 insertions(+), 40 deletions(-)

Hi Albert,

Thank you for your work on the Wireless Space. It is nice to have this
patch.

> 
> diff --git a/board/LaCie/netspace_v2/netspace_v2.c b/board/LaCie/netspace_v2/netspace_v2.c
> index 101a80a..084f0cf 100644
> --- a/board/LaCie/netspace_v2/netspace_v2.c
> +++ b/board/LaCie/netspace_v2/netspace_v2.c
> @@ -39,40 +39,7 @@ int board_early_init_f(void)
>  			NETSPACE_V2_OE_LOW, NETSPACE_V2_OE_HIGH);
>  
>  	/* Multi-Purpose Pins Functionality configuration */
> -	u32 kwmpp_config[] = {
> -		MPP0_SPI_SCn,
> -		MPP1_SPI_MOSI,
> -		MPP2_SPI_SCK,
> -		MPP3_SPI_MISO,
> -		MPP4_NF_IO6,
> -		MPP5_NF_IO7,
> -		MPP6_SYSRST_OUTn,
> -		MPP7_GPO,		/* Fan speed (bit 1) */
> -		MPP8_TW_SDA,
> -		MPP9_TW_SCK,
> -		MPP10_UART0_TXD,
> -		MPP11_UART0_RXD,
> -		MPP12_GPO,		/* Red led */
> -		MPP14_GPIO,		/* USB fuse */
> -		MPP16_GPIO,		/* SATA 0 power */
> -		MPP17_GPIO,		/* SATA 1 power */
> -		MPP18_NF_IO0,
> -		MPP19_NF_IO1,
> -		MPP20_SATA1_ACTn,
> -		MPP21_SATA0_ACTn,
> -		MPP22_GPIO,		/* Fan speed (bit 0) */
> -		MPP23_GPIO,		/* Fan power */
> -		MPP24_GPIO,		/* USB mode select */
> -		MPP25_GPIO,		/* Fan rotation fail */
> -		MPP26_GPIO,		/* USB vbus-in detection */
> -		MPP28_GPIO,		/* USB enable vbus-out */
> -		MPP29_GPIO,		/* Blue led (slow register) */
> -		MPP30_GPIO,		/* Blue led (command register) */
> -		MPP31_GPIO,		/* Board power off */
> -		MPP32_GPIO,		/* Button (0 = Released, 1 = Pushed) */
> -		MPP33_GPIO,		/* Fan speed (bit 2) */
> -		0
> -	};
> +	u32 kwmpp_config[] = NETSPACE_V2_MPP_CONFIG;
>  	kirkwood_mpp_conf(kwmpp_config, NULL);
>  
>  	return 0;
> @@ -107,10 +74,11 @@ int misc_init_r(void)
>  /* Configure and initialize PHY */
>  void reset_phy(void)
>  {
> -#if defined(CONFIG_NETSPACE_LITE_V2) || defined(CONFIG_NETSPACE_MINI_V2)
> -	mv_phy_88e1318_init("egiga0", 0);
> -#else
> -	mv_phy_88e1116_init("egiga0", 8);
> +#ifdef CONFIG_EGIGA0_PHY
> +	mv_phy_88e1116_init("egiga0", CONFIG_EGIGA0_PHY);
> +#endif
> +#ifdef CONFIG_EGIGA1_PHY
> +	mv_phy_88e1116_init("egiga1", CONFIG_EGIGA1_PHY);
>  #endif
>  }
>  #endif
> diff --git a/board/LaCie/netspace_v2/netspace_v2.h b/board/LaCie/netspace_v2/netspace_v2.h
> index 34e492c..1f0eefd 100644
> --- a/board/LaCie/netspace_v2/netspace_v2.h
> +++ b/board/LaCie/netspace_v2/netspace_v2.h
> @@ -24,11 +24,132 @@
>  #define NETSPACE_V2_H
>  
>  /* GPIO configuration */
> +
> +/* Net Space V2, Net Space Max V2, Internet Space V2: */
> +#if defined(CONFIG_NETSPACE_MAX_V2) \
> +	|| defined(CONFIG_NETSPACE_V2) \
> +	|| defined(CONFIG_NET2BIG_V2) \
> +	|| defined(CONFIG_INETSPACE_V2)

I think you missed here a couple of 'defined()' for the boards ns2lite
and ns2mini.

Moreover, don't you think that the Wireless Space could have his own
board files ? I mean, there is almost no common hardware between ws and
ns2 boards. I think it is confusing to have NETSPACE_V2_ macros to
designate MPP and GPIO configuration for both ns2 and ws.

> +
>  #define NETSPACE_V2_OE_LOW		0x06004000
>  #define NETSPACE_V2_OE_HIGH		0x00000031
>  #define NETSPACE_V2_OE_VAL_LOW		0x10030000
>  #define NETSPACE_V2_OE_VAL_HIGH		0x00000000
>  
> +/* Wireless Space */
> +
> +#elif defined(CONFIG_WIRELESS_SPACE)
> +
> +#define NETSPACE_V2_OE_LOW		0xFF006808
> +#define NETSPACE_V2_OE_HIGH		0x0000F989
> +#define NETSPACE_V2_OE_VAL_LOW		0x00000000
> +#define NETSPACE_V2_OE_VAL_HIGH		0x00000000
> +
> +#else
> +
> +#error Undefined or unsupported LaCie KW board variant
> +
> +#endif
> +
>  #define NETSPACE_V2_GPIO_BUTTON         32
>  
> +/* MPP configuration */
> +
> +/* Net Space V2, Net Space Max V2, Internet Space V2: */
> +#if defined(CONFIG_NETSPACE_MAX_V2) \
> +	|| defined(CONFIG_NETSPACE_V2) \
> +	|| defined(CONFIG_NET2BIG_V2) \
> +	|| defined(CONFIG_INETSPACE_V2)
> +
> +#define NETSPACE_V2_MPP_CONFIG	{ \
> +	MPP0_SPI_SCn, \
> +	MPP1_SPI_MOSI, \
> +	MPP2_SPI_SCK, \
> +	MPP3_SPI_MISO, \
> +	MPP4_NF_IO6, \
> +	MPP5_NF_IO7, \
> +	MPP6_SYSRST_OUTn, \
> +	MPP7_GPO,		/* Fan speed (bit 1) */ \
> +	MPP8_TW_SDA, \
> +	MPP9_TW_SCK, \
> +	MPP10_UART0_TXD, \
> +	MPP11_UART0_RXD, \
> +	MPP12_GPO,		/* Red led */ \
> +	MPP14_GPIO,		/* USB fuse */ \
> +	MPP16_GPIO,		/* SATA 0 power */ \
> +	MPP17_GPIO,		/* SATA 1 power */ \
> +	MPP18_NF_IO0, \
> +	MPP19_NF_IO1, \
> +	MPP20_SATA1_ACTn, \
> +	MPP21_SATA0_ACTn, \
> +	MPP22_GPIO,		/* Fan speed (bit 0) */ \
> +	MPP23_GPIO,		/* Fan power */ \
> +	MPP24_GPIO,		/* USB mode select */ \
> +	MPP25_GPIO,		/* Fan rotation fail */ \
> +	MPP26_GPIO,		/* USB vbus-in detection */ \
> +	MPP28_GPIO,		/* USB enable vbus-out */ \
> +	MPP29_GPIO,		/* Blue led (slow register) */ \
> +	MPP30_GPIO,		/* Blue led (command register) */ \
> +	MPP31_GPIO,		/* Board power off */ \
> +	MPP32_GPIO,		/* Button (0 = Released, 1 = Pushed) */ \
> +	MPP33_GPIO,		/* Fan speed (bit 2) */ \
> +	0 \
> +	}
> +
> +#elif defined(CONFIG_WIRELESS_SPACE)
> +
> +#define NETSPACE_V2_MPP_CONFIG	{ \
> +	MPP0_NF_IO2, \
> +	MPP1_NF_IO3, \
> +	MPP2_NF_IO4, \
> +	MPP3_NF_IO5, \
> +	MPP4_NF_IO6, \
> +	MPP5_NF_IO7, \
> +	MPP6_SYSRST_OUTn, \
> +	MPP7_GPO,		/* Fan speed (bit 1) */ \
> +	MPP8_TW_SDA, \
> +	MPP9_TW_SCK, \
> +	MPP10_UART0_TXD, \
> +	MPP11_UART0_RXD, \
> +	MPP13_GPIO,		/* Red led */ \
> +	MPP14_GPIO,		/* USB fuse */ \
> +	MPP15_SATA0_ACTn, \
> +	MPP16_GPIO,		/* SATA 0 power */ \
> +	MPP17_GPIO,		/* SATA 1 power */ \
> +	MPP18_NF_IO0, \
> +	MPP19_NF_IO1, \
> +	MPP20_GE1_0,		/* Gigabit Ethernet 1 */ \
> +	MPP21_GE1_1, \
> +	MPP22_GE1_2, \
> +	MPP23_GE1_3, \
> +	MPP24_GE1_4, \
> +	MPP25_GE1_5, \
> +	MPP26_GE1_6, \
> +	MPP27_GE1_7, \
> +	MPP28_GE1_8, \
> +	MPP29_GE1_9, \
> +	MPP30_GE1_10, \
> +	MPP31_GE1_11, \
> +	MPP32_GE1_12, \
> +	MPP33_GE1_13, \
> +	MPP34_GE1_14, \
> +	MPP35_GE1_15, \
> +	MPP36_GPIO,		/* Fan speed (bit 2) */ \
> +	MPP37_GPIO,		/* Fan speed (bit 0) */ \
> +	MPP38_GPIO,		/* Fan power */ \
> +	MPP39_GPIO,		/* Fan rotation fail */ \
> +	MPP40_GPIO,		/* Ethernet switch link */ \
> +	MPP41_GPIO,		/* USB enable host vbus */ \
> +	MPP42_GPIO,		/* LED clock control */ \
> +	MPP43_GPIO,		/* WPS button (0=Pushed, 1=Released) */ \
> +	MPP44_GPIO,		/* Red LED on/off */ \
> +	MPP45_GPIO,		/* Red LED timer blink (on=off=100ms) */ \
> +	MPP46_GPIO,		/* Green LED on/off */ \
> +	MPP47_GPIO,		/* LED (blue, green) SATA activity blink */ \
> +	MPP48_GPIO,		/* Blue LED on/off */ \
> +	0 \
> +	}
> +
> +#endif
> +
>  #endif /* NETSPACE_V2_H */
> diff --git a/boards.cfg b/boards.cfg
> index d467f56..3f49b18 100644
> --- a/boards.cfg
> +++ b/boards.cfg
> @@ -168,6 +168,7 @@ netspace_lite_v2             arm         arm926ejs   netspace_v2         LaCie
>  netspace_max_v2              arm         arm926ejs   netspace_v2         LaCie          kirkwood	lacie_kw:NETSPACE_MAX_V2
>  netspace_mini_v2             arm         arm926ejs   netspace_v2         LaCie          kirkwood	lacie_kw:NETSPACE_MINI_V2
>  netspace_v2                  arm         arm926ejs   netspace_v2         LaCie          kirkwood	lacie_kw:NETSPACE_V2
> +wireless_space               arm         arm926ejs   netspace_v2         LaCie          kirkwood	lacie_kw:WIRELESS_SPACE
>  dreamplug                    arm         arm926ejs   -                   Marvell        kirkwood
>  guruplug                     arm         arm926ejs   -                   Marvell        kirkwood
>  mv88f6281gtw_ge              arm         arm926ejs   -                   Marvell        kirkwood
> diff --git a/include/configs/lacie_kw.h b/include/configs/lacie_kw.h
> index 09b5798..fdbc785 100644
> --- a/include/configs/lacie_kw.h
> +++ b/include/configs/lacie_kw.h
> @@ -44,6 +44,10 @@
>  #elif defined(CONFIG_NET2BIG_V2)
>  #define CONFIG_MACH_TYPE		MACH_TYPE_NET2BIG_V2
>  #define CONFIG_IDENT_STRING		" 2Big v2"
> +#elif defined(CONFIG_WIRELESS_SPACE)
> +#define MACH_TYPE_WIRELESS_SPACE	2500 /* is missing in mach-types.h */
> +#define CONFIG_MACH_TYPE		MACH_TYPE_WIRELESS_SPACE
> +#define CONFIG_IDENT_STRING		" Wireless Space"
>  #else
>  #error "Unknown board"
>  #endif
> @@ -96,6 +100,12 @@
>  #define CONFIG_SYS_KWD_CONFIG $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage-ns2l.cfg
>  #endif
>  
> +#ifdef CONFIG_WIRELESS_SPACE
> +/* No SPI but NAND */
> +#undef CONFIG_CMD_SF
> +#define CONFIG_CMD_NAND
> +#endif
> +
>  /*
>   * mv-common.h should be defined after CMD configs since it used them
>   * to enable certain macros
> @@ -115,8 +125,14 @@
>  #define CONFIG_SYS_PROMPT		"d2v2> "
>  #elif defined(CONFIG_NET2BIG_V2)
>  #define CONFIG_SYS_PROMPT		"2big2> "
> -#else
> +#elif defined(CONFIG_NETSPACE_V2)
>  #define CONFIG_SYS_PROMPT		"ns2> "
> +#elif defined(CONFIG_INETSPACE_V2)
> +#define CONFIG_SYS_PROMPT		"is2> "
> +#elif defined(CONFIG_WIRELESS_SPACE)
> +#define CONFIG_SYS_PROMPT		"ws> "
> +#else
> +#define CONFIG_SYS_PROMPT		"lacie-kw> "

Maybe you may add here the prompts for the ns2mini and ns2lite boards.
Also, we could move all the prompts with the machine number definitions.
This would allow to remove a couple of ifdef statements.

>  #endif
>  
>  /*
> @@ -124,9 +140,22 @@
>   */
>  #ifdef CONFIG_CMD_NET
>  #define CONFIG_MISC_INIT_R /* Call misc_init_r() to initialize MAC address */
> +#if defined(CONFIG_WIRELESS_SPACE)
> +#define CONFIG_MVGBE_PORTS		{1, 1}	/* enable both ports */
> +#define CONFIG_EGIGA1_PHY		0x6	/* ONLY egiga1 has a PHY */
> +#define CONFIG_MVGBE_PHY_ADRS	{0xa, 0x6}
> +#define CONFIG_MII
> +#define CONFIG_SYS_FAULT_ECHO_LINK_DOWN
> +#else
>  #define CONFIG_MVGBE_PORTS		{1, 0} /* enable port 0 only */
> -#define CONFIG_NETCONSOLE
> +#if defined(CONFIG_NETSPACE_LITE_V2) || defined(CONFIG_NETSPACE_MINI_V2)
> +#define CONFIG_EGIGA0_PHY		0x0
> +#else
> +#define CONFIG_EGIGA0_PHY		0x8
>  #endif
> +#endif /* CONFIG_WIRELESS_SPACE */
> +#define CONFIG_NETCONSOLE
> +#endif /* CONFIG_CMD_NET */
>  
>  /*
>   * SATA Driver configuration
> @@ -186,11 +215,20 @@
>  /*
>   * Environment variables configurations
>   */
> +
> +#if defined(CONFIG_WIRELESS_SPACE)
> +#define CONFIG_ENV_IS_IN_NAND
> +#define CONFIG_ENV_SECT_SIZE		0x10000	/* 64KB */
> +#define CONFIG_ENV_SIZE			0x1000	/* 4KB */
> +#define CONFIG_ENV_ADDR			0x70000
> +#define CONFIG_ENV_OFFSET		0x70000	/* env starts here */
> +#else
>  #define CONFIG_ENV_IS_IN_SPI_FLASH
>  #define CONFIG_ENV_SECT_SIZE		0x10000	/* 64KB */
>  #define CONFIG_ENV_SIZE			0x1000	/* 4KB */
>  #define CONFIG_ENV_ADDR			0x70000
>  #define CONFIG_ENV_OFFSET		0x70000	/* env starts here */
> +#endif

There is some reason for the duplicate lines here ?

Regards,

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

  parent reply	other threads:[~2012-10-20  0:17 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-16 18:08 [U-Boot] [PATCH] ARM: lacie_kw: add support for WIRELESS_SPACE Albert ARIBAUD
2012-08-17  7:59 ` Prafulla Wadaskar
2012-08-17 17:37   ` Albert ARIBAUD
2012-08-17 17:55 ` Tom Rini
2012-08-17 21:28   ` Albert ARIBAUD
2012-08-21  7:16     ` Prafulla Wadaskar
2012-08-22 15:16       ` Simon Guinot
2012-09-22  8:51         ` Albert ARIBAUD
2012-09-22 17:38           ` Tom Rini
2012-10-05 20:40             ` Albert ARIBAUD
2012-10-19 21:38 ` [U-Boot] [PATCH v2 1/2] mvgbe: allow non-sequential PHY addresses Albert ARIBAUD
2012-10-19 21:38   ` [U-Boot] [PATCH v2 2/2] ARM: lacie_kw: add support for WIRELESS_SPACE Albert ARIBAUD
2012-10-19 22:57     ` Albert ARIBAUD
2012-10-20  0:17     ` Simon Guinot [this message]
2012-10-27 12:11       ` Albert ARIBAUD
2012-10-19 23:57   ` [U-Boot] [PATCH v3 1/2] mvgbe: allow non-sequential PHY addresses Albert ARIBAUD
2012-10-19 23:57     ` [U-Boot] [PATCH v3 2/2] ARM: lacie_kw: add support for WIRELESS_SPACE Albert ARIBAUD
2012-11-04 23:32       ` [U-Boot] [PATCH v4 1/4] mvgbe: allow non-sequential PHY addresses Albert ARIBAUD
2012-11-04 23:32         ` [U-Boot] [PATCH v4 2/4] mv88e61xx: refactor PHY and SWITCH level-code Albert ARIBAUD
2012-11-04 23:32           ` [U-Boot] [PATCH v4 3/4] kirkwood: make MPP arrays static const Albert ARIBAUD
2012-11-04 23:32             ` [U-Boot] [PATCH v4 4/4] ARM: lacie_kw: add support for WIRELESS_SPACE Albert ARIBAUD
2012-11-10  7:09               ` Prafulla Wadaskar
2012-11-25  3:21                 ` Albert ARIBAUD
2012-11-25  6:41                   ` Prafulla Wadaskar
2012-11-10  7:02             ` [U-Boot] [PATCH v4 3/4] kirkwood: make MPP arrays static const Prafulla Wadaskar
2012-11-10  6:56           ` [U-Boot] [PATCH v4 2/4] mv88e61xx: refactor PHY and SWITCH level-code Prafulla Wadaskar
2012-11-10  6:41         ` [U-Boot] [PATCH v4 1/4] mvgbe: allow non-sequential PHY addresses Prafulla Wadaskar
2012-11-26 21:27         ` [U-Boot] [PATCH v5 0/3] Add support for the LaCie Wireless Space Albert ARIBAUD
2012-11-26 21:27           ` [U-Boot] [PATCH v5 1/3] mv88e61xx: refactor PHY and SWITCH level-code Albert ARIBAUD
2012-11-26 21:27             ` [U-Boot] [PATCH v5 2/3] kirkwood: make MPP arrays static const Albert ARIBAUD
2012-11-26 21:27               ` [U-Boot] [PATCH v5 3/3] ARM: lacie_kw: add support for WIRELESS_SPACE Albert ARIBAUD
2012-12-20  6:51           ` [U-Boot] [PATCH v5 0/3] Add support for the LaCie Wireless Space Prafulla Wadaskar

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=20121020001723.GI28384@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.