Add disk support to orion5x and edminiv2
Subsystems (3)
v8 cover Add disk support to orion5x and edminiv2
Patchset history:
V1: Initial 4-patch set -- not cleanly submitted (does
not appear on gmane for instance) and contained some unrelated changes.
V2: Slimmed down to 3 patches and removed unrelated
changes.
V3: Back to 4 patches (cmd_ide improvement, driver addition,
cmd_ide support for orion, edminiv2 support for sata);
made initialization code reuseable as a block driver ;
moved to C structures; commented some constants.V4: Reordered objects alphabetically in drivers/block/Makefile.
Shortened mv_sata to mvsata.
Removed volatile qualifier in mvsata port structure. Moved port pointer definition from SoC to board code. Removed unrelated changes.
V5: Fixed typo in mvsata_ide driver (IMP, should have been IPM).
V6: Fixed case in ide register struct.
Fixed warning in deminiv2.c
Put IDE configuration under condition.
V7: Reworked the initialization logic to poll status register.
Moved initialization from board code to driver code. Removed driver header file and moved its content to driver code. Moved CONFIG_IDE_PREINIT from SoC to board config file.
V8: Separated V7's patch 2 in two independant patches.
Fixed typo in struct names within ide_preinit().
The V8 patches have been run through checkpatch.pl --no-tree with no errors or warnings, and have been tested on an ED Mini V2.
Albert Aribaud (5):
ide: add configuration CONFIG_IDE_SWAP_IO
ide: reorder object files alphabetically
ide: add mvsata_ide driver
cmd_ide: add support for orion5x
edminiv2: add mvsata_ide and cmd_ide support
arch/arm/include/asm/arch-orion5x/orion5x.h | 3 + arch/powerpc/include/asm/config.h | 3 + common/cmd_ide.c | 23 +++-- doc/README.PXA_CF | 8 ++ drivers/block/Makefile | 7 +- drivers/block/mvsata_ide.c | 140 +++++++++++++++++++++++++++ include/configs/ap325rxa.h | 1 + include/configs/edminiv2.h | 34 ++++++- include/configs/ms7720se.h | 1 + include/configs/r2dplus.h | 1 + include/configs/r7780mp.h | 1 + 11 files changed, 209 insertions(+), 13 deletions(-) create mode 100644 drivers/block/mvsata_ide.c
PATCH v8 1/5 ide: add configuration CONFIG_IDE_SWAP_IO
This configuration option replaces a complex conditional in cmd_ide.c with an explicit define to be added to SoC or board configs.
--- arch/powerpc/include/asm/config.h | 3 +++ common/cmd_ide.c | 18 +++++++++--------- doc/README.PXA_CF | 8 ++++++++ include/configs/ap325rxa.h | 1 + include/configs/ms7720se.h | 1 + include/configs/r2dplus.h | 1 + include/configs/r7780mp.h | 1 + 7 files changed, 24 insertions(+), 9 deletions(-)
arch/powerpc/include/asm/config.h +3 -0
@@ -95,4 +95,7 @@#define CONFIG_FSL_LBC #endif +/* All PPC boards must swap IDE bytes */ +#define CONFIG_IDE_SWAP_IO +#endif /* _ASM_CONFIG_H_ */
common/cmd_ide.c +9 -9
@@ -847,7 +847,7 @@ input_swap_data(int dev, ulong *sect_buf, int words)#endif /* __LITTLE_ENDIAN || CONFIG_AU1X00 */ -#if defined(__PPC__) || defined(CONFIG_PXA_PCMCIA ) || defined(CONFIG_SH ) +#if defined(CONFIG_IDE_SWAP_IO )static void output_data (int dev,ulong *sect_buf,int words) {
@@ -891,15 +891,15 @@ output_data(int dev, ulong *sect_buf, int words) }#endif } -#else /* ! __PPC__ */ +#else /* ! CONFIG_IDE_SWAP_IO */ static void output_data (int dev,ulong *sect_buf,int words) {outsw (ATA_CURR_BASE (dev)+ATA_DATA_REG , sect_buf, words<<1 ); } -#endif /* __PPC__ */ +#endif /* CONFIG_IDE_SWAP_IO */ -#if defined(__PPC__) || defined(CONFIG_PXA_PCMCIA ) || defined(CONFIG_SH ) +#if defined(CONFIG_IDE_SWAP_IO )static void input_data (int dev,ulong *sect_buf,int words) {
@@ -949,14 +949,14 @@ input_data(int dev, ulong *sect_buf, int words) }#endif } -#else /* ! __PPC__ */ +#else /* ! CONFIG_IDE_SWAP_IO */ static void input_data (int dev,ulong *sect_buf,int words) {insw (ATA_CURR_BASE (dev)+ATA_DATA_REG , sect_buf, words <<1 ); } -#endif /* __PPC__ */ +#endif /* CONFIG_IDE_SWAP_IO */ /* ------------------------------------------------------------------------- */
@@ -1573,7 +1573,7 @@ int ide_device_present(int dev)* ATAPI Support */ -#if defined(__PPC__) || defined(CONFIG_PXA_PCMCIA ) +#if defined(CONFIG_IDE_SWAP_IO )/* since ATAPI may use commands with not 4 bytes alligned length * we have our own transfer functions, 2 bytes alligned */ static void
@@ -1640,7 +1640,7 @@ input_data_shorts(int dev, ushort *sect_buf, int shorts)#endif } -#else /* ! __PPC__ */ +#else /* ! CONFIG_IDE_SWAP_IO */ static void output_data_shorts (int dev,ushort *sect_buf,int shorts) {
@@ -1653,7 +1653,7 @@ input_data_shorts(int dev, ushort *sect_buf, int shorts) insw(ATA_CURR_BASE(dev)+ATA_DATA_REG, sect_buf, shorts); } -#endif /* __PPC__ */ +#endif /* CONFIG_IDE_SWAP_IO */ /* * Wait until (Status & mask) == res, or timeout (in ms)
doc/README.PXA_CF +8 -0
@@ -6,6 +6,14 @@ follow the connections of the standard lubbock. Anyway just the block marked memory configuration should be touched since the other parameters are imposed by the PXA architecture. +EDIT 2010-07-01: in common/cmd_ide.c, having CONFIG_PXA_PCMCIA defined +would cause looping on inw()/outw() rather than using insw()/outsw(), +thus making sure IDE / ATA bytes are properly swapped. This behaviour +is now controlled by CONFIG_IDE_SWAP_IO, therefore PXA boards with +PCMCIA should #define CONFIG_IDE_SWAP_IO. + +#define CONFIG_IDE_SWAP_IO + #define CONFIG_PXA_PCMCIA 1 #define CONFIG_PXA_IDE 1
include/configs/ap325rxa.h +1 -0
@@ -138,6 +138,7 @@#define CONFIG_SYS_ATA_DATA_OFFSET 0x200/* data reg offset */ #define CONFIG_SYS_ATA_REG_OFFSET 0x200/* reg offset */ #define CONFIG_SYS_ATA_ALT_OFFSET 0x210/* alternate register offset */ +#define CONFIG_IDE_SWAP_IO /* if you use all NOR Flash , you change dip-switch. Please see Manual. */ #define CONFIG_SYS_MAX_FLASH_BANKS 1
include/configs/ms7720se.h +1 -0
@@ -122,5 +122,6 @@#define CONFIG_SYS_ATA_DATA_OFFSET 0/* data reg offset */ #define CONFIG_SYS_ATA_REG_OFFSET 0/* reg offset */ #define CONFIG_SYS_ATA_ALT_OFFSET 0x200/* alternate register offset */ +#define CONFIG_IDE_SWAP_IO #endif /* __MS7720SE_H */
include/configs/r2dplus.h +1 -0
@@ -96,6 +96,7 @@#define CONFIG_SYS_ATA_DATA_OFFSET 0x1000/* data reg offset */ #define CONFIG_SYS_ATA_REG_OFFSET 0x1000/* reg offset */ #define CONFIG_SYS_ATA_ALT_OFFSET 0x800/* alternate register offset */ +#define CONFIG_IDE_SWAP_IO /* * SuperH PCI Bridge Configration
include/configs/r7780mp.h +1 -0
@@ -171,6 +171,7 @@#define CONFIG_SYS_ATA_DATA_OFFSET 0x1000/* data reg offset */ #define CONFIG_SYS_ATA_REG_OFFSET 0x1000/* reg offset */ #define CONFIG_SYS_ATA_ALT_OFFSET 0x800/* alternate register offset */ +#define CONFIG_IDE_SWAP_IO #endif /* CONFIG_CMD_IDE */ #endif /* __R7780RP_H */
Signature · 1 line
1.6.4.4
PATCH v8 2/5 ide: reorder object files alphabetically
--- drivers/block/Makefile | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/block/Makefile +3 -3
@@ -25,15 +25,15 @@ include $(TOPDIR)/config.mk LIB := $(obj)libblock.a +COBJS-$(CONFIG_SCSI_AHCI) += ahci.o COBJS-$(CONFIG_ATA_PIIX) += ata_piix.o -COBJS-$(CONFIG_CMD_MG_DISK) += mg_disk.o COBJS-$(CONFIG_FSL_SATA) += fsl_sata.o -COBJS-$(CONFIG_IDE_SIL680) += sil680.o COBJS-$(CONFIG_LIBATA) += libata.o +COBJS-$(CONFIG_CMD_MG_DISK) += mg_disk.o COBJS-$(CONFIG_PATA_BFIN) += pata_bfin.o COBJS-$(CONFIG_SATA_DWC) += sata_dwc.o COBJS-$(CONFIG_SATA_SIL3114) += sata_sil3114.o -COBJS-$(CONFIG_SCSI_AHCI) += ahci.o +COBJS-$(CONFIG_IDE_SIL680) += sil680.o COBJS-$(CONFIG_SCSI_SYM53C8XX) += sym53c8xx.o COBJS-$(CONFIG_SYSTEMACE) += systemace.o
Signature · 1 line
1.6.4.4
PATCH v8 3/5 ide: add mvsata_ide driver
This driver only provides initialization code; actual driving is done by cmd_ide.c using the ATA compatibility mode of the Marvell SATAHC controller.
--- drivers/block/Makefile | 1 + drivers/block/mvsata_ide.c | 140 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+), 0 deletions(-) create mode 100644 drivers/block/mvsata_ide.c
drivers/block/Makefile +1 -0
@@ -30,6 +30,7 @@ COBJS-$(CONFIG_ATA_PIIX) += ata_piix.o COBJS-$(CONFIG_FSL_SATA) += fsl_sata.o COBJS-$(CONFIG_LIBATA) += libata.o COBJS-$(CONFIG_CMD_MG_DISK) += mg_disk.o +COBJS-$(CONFIG_MVSATA_IDE) += mvsata_ide.o COBJS-$(CONFIG_PATA_BFIN) += pata_bfin.o COBJS-$(CONFIG_SATA_DWC) += sata_dwc.o COBJS-$(CONFIG_SATA_SIL3114) += sata_sil3114.o
drivers/block/mvsata_ide.c new file +140 -0
140 lines not on this page · raw message
Signature · 1 line
1.6.4.4
PATCH v8 4/5 cmd_ide: add support for orion5x
Add MVSATAHC definitions to orion5x.
Add support for orion5x in cmd_ide.
--- arch/arm/include/asm/arch-orion5x/orion5x.h | 3 +++ common/cmd_ide.c | 5 +++++ 2 files changed, 8 insertions(+), 0 deletions(-)
arch/arm/include/asm/arch-orion5x/orion5x.h +3 -0
@@ -55,6 +55,9 @@#define ORION5X_USB20_PORT0_BASE (ORION5X_REGISTER(0x50000))#define ORION5X_USB20_PORT1_BASE (ORION5X_REGISTER(0xA0000))#define ORION5X_EGIGA_BASE (ORION5X_REGISTER(0x72000)) +#define ORION5X_SATA_BASE (ORION5X_REGISTER(0x80000)) +#define ORION5X_SATA_PORT0_OFFSET 0x2000 +#define ORION5X_SATA_PORT1_OFFSET 0x4000/* Orion5x GbE controller has a single port */ #define MAX_MVGBE_DEVS 1
common/cmd_ide.c +5 -0
@@ -25,6 +25,7 @@/* * IDE support */ +#include <common.h> #include <config.h> #include <watchdog.h>
@@ -45,6 +46,10 @@#include <mpc5xxx.h> #endif +#ifdef CONFIG_ORION5X +#include <asm/arch/orion5x.h> +#endif +#include <ide.h> #include <ata.h>
Signature · 1 line
1.6.4.4
PATCH v8 5/5 edminiv2: add mvsata_ide and cmd_ide support
Add mvsata_ide and cmd_ide configuration in edminiv2 config
--- include/configs/edminiv2.h | 34 +++++++++++++++++++++++++++++++++- 1 files changed, 33 insertions(+), 1 deletions(-)
include/configs/edminiv2.h +33 -1
@@ -60,7 +60,7 @@#define ORION5X_MPP0_7 0x00000003#define ORION5X_MPP8_15 0x55550000 -#define ORION5X_MPP16_23 0x00000000 +#define ORION5X_MPP16_23 0x00005555/* * Board-specific values for Orion5x GPIO low level init:
@@ -131,6 +131,7 @@* Commands configuration - using default command set for now */ #include <config_cmd_default.h> +#define CONFIG_CMD_IDE /* * Network
@@ -150,6 +151,37 @@#endif /* +* IDE +*/ +#ifdef CONFIG_CMD_IDE +#define __io +#define CONFIG_IDE_PREINIT +#define CONFIG_DOS_PARTITION +#define CONFIG_CMD_EXT2 +/* ED Mini V has an IDE-compatible SATA connector for port 1 */ +#define CONFIG_MVSATA_IDE +#define CONFIG_MVSATA_IDE_USE_PORT1 +/* Needs byte-swapping for ATA data register */ +#define CONFIG_IDE_SWAP_IO +/* Data, registers and alternate blocks are at the same offset */ +#define CONFIG_SYS_ATA_DATA_OFFSET (0x0100) +#define CONFIG_SYS_ATA_REG_OFFSET (0x0100) +#define CONFIG_SYS_ATA_ALT_OFFSET (0x0100) +/* Each 8-bit ATA register is aligned to a 4-bytes address */ +#define CONFIG_SYS_ATA_STRIDE 4 +/* Controller supports 48-bits LBA addressing */ +#define CONFIG_LBA48 +/* A single bus, a single device */ +#define CONFIG_SYS_IDE_MAXBUS 1 +#define CONFIG_SYS_IDE_MAXDEVICE 1 +/* ATA registers base is at SATA controller base */ +#define CONFIG_SYS_ATA_BASE_ADDR ORION5X_SATA_BASE +/* ATA bus 0 is orion5x port 1 on ED Mini V2 */ +#define CONFIG_SYS_ATA_IDE0_OFFSET ORION5X_SATA_PORT1_OFFSET +/* end of IDE defines */ +#endif /* CMD_IDE */ + +/* * Environment variables configurations */ #define CONFIG_ENV_IS_IN_FLASH 1
Signature · 1 line
1.6.4.4
PATCH v8 5/5 edminiv2: add mvsata_ide and cmd_ide support
Quoted 10 lines
-----Original Message-----
From: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Albert Aribaud
Sent: Saturday, August 07, 2010 6:22 PM
To: u-boot at lists.denx.de
Subject: [U-Boot] [PATCH V8 5/5] edminiv2: addmvsata_ideandcmd_idesupport
Quoted 6 lines
Add
mvsata_ideandcmd_ideconfiguration in edminiv2 configSigned-off-by Albert Aribaud <[email protected]>--- include/configs/edminiv2.h | 34 +++++++++++++++++++++++++++++++++- 1 files changed, 33 insertions(+), 1 deletions(-)
Applied to u-boot-marvell.git master branch
Regards..
Prafulla . .
PATCH v8 5/5 edminiv2: add mvsata_ide and cmd_ide support
In reply to Albert Aribaudinclude/configs/edminiv2.h line 163
Quoted 8 lines · Albert Aribaud
Add
mvsata_ideandcmd_ideconfiguration in edminiv2 configSigned-off-by Albert Aribaud<[email protected]>---
include/configs/edminiv2.h +3
-0+/* ED Mini V has an IDE-compatible SATA connector for port 1 */ +#define CONFIG_MVSATA_IDE +#define CONFIG_MVSATA_IDE_USE_PORT1
Hi Albert,
I'm trying to get IDE to work with my DNS323, which uses both SATA ports, but am being unsuccessful.
It seems that there may be something incorrectly merged, perhaps:
$ git grep CONFIG_MVSATA_IDE_USE_PORT include/configs/edminiv2.h:#define CONFIG_MVSATA_IDE_USE_PORT1 include/configs/openrd_base.h:#define CONFIG_MVSATA_IDE_USE_PORT1 $
i.e. CONFIG_MVSATA_IDE_USE_PORT1 is defined, but never used for anything.
Regards,
Rogan
PATCH v8 4/5 cmd_ide: add support for orion5x
In reply to Albert AribaudQuoted 9 lines
-----Original Message-----
From: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Albert Aribaud
Sent: Saturday, August 07, 2010 6:22 PM
To: u-boot at lists.denx.de
Subject: [U-Boot] [PATCH V8 4/5]cmd_ide: add support for orion5x
Quoted 8 lines
Add MVSATAHC definitions to orion5x.
Add support for orion5x incmd_ide.Signed-off-by Albert Aribaud <[email protected]>--- arch/arm/include/asm/arch-orion5x/orion5x.h | 3 +++ common/cmd_ide.c | 5 +++++ 2 files changed, 8 insertions(+), 0 deletions(-)
Applied to u-boot-marvell.git master branch
Regards..
Prafulla . .
PATCH v8 3/5 ide: add mvsata_ide driver
In reply to Albert AribaudQuoted 13 lines
-----Original Message-----
From: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Albert Aribaud
Sent: Saturday, August 07, 2010 6:22 PM
To: u-boot at lists.denx.de
Subject: [U-Boot] [PATCH V8 3/5] ide: addmvsata_idedriverThis driver only provides initialization code; actual driving is done by
cmd_ide.cusing the ATA compatibility mode of the Marvell SATAHC controller.
Quoted 7 lines
Signed-off-by Albert Aribaud <[email protected]>--- drivers/block/Makefile | 1 + drivers/block/mvsata_ide.c | 140 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+), 0 deletions(-) create mode 100644 drivers/block/mvsata_ide.c
Applied to u-boot-marvell.git
Regards..
Prafulla . .
PATCH v8 2/5 ide: reorder object files alphabetically
In reply to Albert AribaudQuoted 11 lines
-----Original Message-----
From: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Albert Aribaud
Sent: Saturday, August 07, 2010 6:22 PM
To: u-boot at lists.denx.de
Subject: [U-Boot] [PATCH V8 2/5] ide: reorder object files alphabetically
Quoted 5 lines
Signed-off-by Albert Aribaud <[email protected]>--- drivers/block/Makefile | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
Applied to u-boot-marvell.git
Regards..
Prafulla . .
PATCH v8 1/5 ide: add configuration CONFIG_IDE_SWAP_IO
In reply to Albert AribaudQuoted 15 lines
-----Original Message-----
From: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Albert Aribaud
Sent: Saturday, August 07, 2010 6:22 PM
To: u-boot at lists.denx.de
Subject: [U-Boot] [PATCH V8 1/5] ide: add configurationCONFIG_IDE_SWAP_IOThis configuration option replaces a complex conditional in
cmd_ide.cwith an explicit define to be added to SoC or board configs.Signed-off-by Albert Aribaud <[email protected]>
Quoted 9 lines
--- arch/powerpc/include/asm/config.h | 3 +++ common/cmd_ide.c | 18 +++++++++--------- doc/README.PXA_CF | 8 ++++++++ include/configs/ap325rxa.h | 1 + include/configs/ms7720se.h | 1 + include/configs/r2dplus.h | 1 + include/configs/r7780mp.h | 1 + 7 files changed, 24 insertions(+), 9 deletions(-)
Applied to u-boot-marvell.git
Regards..
Prafulla . .
v8 cover Add disk support to orion5x and edminiv2
In reply to Albert AribaudQuoted 54 lines
-----Original Message-----
From: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Albert Aribaud
Sent: Saturday, August 07, 2010 6:22 PM
To: u-boot at lists.denx.de
Subject: [U-Boot] [PATCH V8 0/5] Add disk support to orion5x and edminiv2Patchset history:
V1: Initial 4-patch set -- not cleanly submitted (does
not appear on gmane for instance) and contained some unrelated changes.V2: Slimmed down to 3 patches and removed unrelated
changes.V3: Back to 4 patches (
cmd_ideimprovement, driver addition,cmd_ide support for orion, edminiv2 support for sata); made initialization code reuseable as a block driver ; moved to C structures; commented some constants.V4: Reordered objects alphabetically in
drivers/block/Makefile.
Shortenedmv_satato mvsata.
Removed volatile qualifier in mvsata port structure. Moved port pointer definition from SoC to board code. Removed unrelated changes.V5: Fixed typo in
mvsata_idedriver (IMP, should have been IPM).V6: Fixed case in ide register struct.
Fixed warning indeminiv2.c
Put IDE configuration under condition.V7: Reworked the initialization logic to poll status register.
Moved initialization from board code to driver code. Removed driver header file and moved its content to driver code. MovedCONFIG_IDE_PREINITfrom SoC to board config file.V8: Separated V7's patch 2 in two independant patches.
Fixed typo in struct names withinide_preinit().The V8 patches have been run through checkpatch.pl --no-tree with no errors or warnings, and have been tested on an ED Mini V2.
Albert Aribaud (5):
ide: add configurationCONFIG_IDE_SWAP_IO
ide: reorder object files alphabetically
ide: addmvsata_idedriver
cmd_ide: add support for orion5x
edminiv2: addmvsata_ideandcmd_idesupport
Quoted 14 lines
arch/arm/include/asm/arch-orion5x/orion5x.h | 3 + arch/powerpc/include/asm/config.h | 3 + common/cmd_ide.c | 23 +++-- doc/README.PXA_CF | 8 ++ drivers/block/Makefile | 7 +- drivers/block/mvsata_ide.c | 140 +++++++++++++++++++++++++++ include/configs/ap325rxa.h | 1 + include/configs/edminiv2.h | 34 ++++++- include/configs/ms7720se.h | 1 + include/configs/r2dplus.h | 1 + include/configs/r7780mp.h | 1 + 11 files changed, 209 insertions(+), 13 deletions(-) create mode 100644 drivers/block/mvsata_ide.c
Applied this patch series to u-boot-marvell.git master branch
Regards..
Prafulla . .
v8 cover Add disk support to orion5x and edminiv2
Le 09/08/2010 07:57, Prafulla Wadaskar a ?crit :
Quoted 8 lines
Quoted 7 lines
-----Original Message-----
From: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Albert Aribaud
Sent: Saturday, August 07, 2010 6:22 PM
To: u-boot at lists.denx.de
Subject: [U-Boot] [PATCH V8 0/5] Add disk support to orion5x and edminiv2
Quoted 4 lines
Applied this patch series to u-boot-marvell.git master branch
Regards..
Prafulla . .
Thanks Prafulla!
Amicalement,
Signature · 1 line
Albert.