Skip to contentSkip to conversation

Canyonlands SATA harddisk driver

PATCH New Kazuaki Ichinohe 6 participants 13 messages May 15, 2009 – Jun 4, 2009 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Canyonlands SATA harddisk driver

This patch adds a SATA harddisk driver for the canyonlands. This patch is kernel driver's porting.
This pach corresponded to not cmd_scsi but cmd_sata.

[environment variable, boot script]
setenv bootargs root=/dev/sda7 rw
setenv bootargs ${bootargs} console=ttyS0,115200 ext2load sata 0:2 0x400000 /canyonlands/uImage ext2load sata 0:2 0x800000 /canyonlands/canyonlands.dtb fdt addr 0x800000 0x4000
bootm 0x400000 - 0x800000

If you drive SATA-2 disk on Canyonlands, you must change parts from PI2PCIE212 to PI2PCIE2212 on U25. We confirmed to boot by using following disk.

1.Vender: Fujitsu Type: MHW2040BS
2.Vender: Fujitsu Type: MHW2060BK
3.Vendor: HAGIWARA SYS-COM:HFD25S-032GT
4.Vender: WesternDigital Type: WD3200BJKT (CONFIG_LBA48 required) 5.Vender: WesternDigital Type: WD3200BEVT (CONFIG_LBA48 required) 6.Vender: hitachi Type: HTS543232L9A300 (CONFIG_LBA48 required) 7.Vender: Seagate Type: ST31000333AS (CONFIG_LBA48 required) 8.Vender: Transcend Type: TS32GSSD25S-M
9.Vender: MTRON Type: MSD-SATA1525-016

---

drivers/block/Makefile +1 -0
diff -uprN u-boot-0515/drivers/block/Makefile u-boot-sata/drivers/block/Makefile
@@ -31,6 +31,7 @@ COBJS-$(CONFIG_FSL_SATA) += fsl_sata.o
 COBJS-$(CONFIG_IDE_SIL680) += sil680.o
 COBJS-$(CONFIG_LIBATA) += libata.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_SCSI_SYM53C8XX) += sym53c8xx.o
drivers/block/sata_dwc.c +2110 -0

2,110 lines not on this page · raw message

drivers/block/sata_dwc.h +463 -0

463 lines not on this page · raw message

include/configs/canyonlands.h +14 -0
diff -uprN u-boot-0515/include/configs/canyonlands.h u-boot-sata/include/configs/canyonlands.h
@@ -451,6 +451,7 @@
 #define CONFIG_CMD_FAT
 #define CONFIG_CMD_NAND
 #define CONFIG_CMD_PCI
+#define CONFIG_CMD_SATA
 #define CONFIG_CMD_SDRAM
 #define CONFIG_CMD_SNTP
 #define CONFIG_CMD_USB
@@ -516,6 +517,19 @@
 #endif /* CONFIG_ARCHES */
 #endif /* CONFIG_460GT */
 
+/*
+ * SATA driver setup
+ */
+#ifdef CONFIG_CMD_SATA
+#define CONFIG_SATA_DWC
+#define CONFIG_LIBATA
+#define SATA_BASE_ADDR		0xe20d1000	/* PPC460EX SATA Base Address */
+#define SATA_DMA_REG_ADDR	0xe20d0800	/* PPC460EX SATA Base Address */
+#define CONFIG_SYS_SATA_MAX_DEVICE	1	/* SATA MAX DEVICE */
+/* Convert sectorsize to wordsize */
+#define ATA_SECTOR_WORDS (ATA_SECT_SIZE/2)
+#endif
+
 /*-----------------------------------------------------------------------
  * External Bus Controller (EBC) Setup
  *----------------------------------------------------------------------*/
#1 lore raw

PATCH 1/1 Canyonlands SATA harddisk driver

Quoted 3 lines · On Friday 15 May 2009 11:32:26 Kazuaki Ichinohe wrote:

This patch adds a SATA harddisk driver for the canyonlands. This patch is kernel driver's porting.
This pach corresponded to not cmd_scsi but cmd_sata.

Looks good now. Thanks for all your effort here.

So:

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================

#2 lore raw

PATCH 1/1 Canyonlands SATA harddisk driver

Quoted 10 lines · Stefan Roese
Quoted 3 lines · On Friday 15 May 2009 11:32:26 Kazuaki Ichinohe wrote:

This patch adds a SATA harddisk driver for the canyonlands. This patch is kernel driver's porting.
This pach corresponded to not cmd_scsi but cmd_sata.

Looks good now. Thanks for all your effort here.

So:

I'm fine with this patch applied or not, but this driver is too big. It has a lot of unused struct members, I'm not sure they'll be used in the future, though.

Shinya

#3 lore raw

PATCH 1/1 Canyonlands SATA harddisk driver

In reply to Kazuaki Ichinohe

Dear Kazuaki Ichinohe,

Quoted 3 lines · In message <[email protected]> you wrote:

This patch adds a SATA harddisk driver for the canyonlands. This patch is kernel driver's porting.
This pach corresponded to not cmd_scsi but cmd_sata.

Stefan Roese acked your patch, but then Shinya Kuribayashi remarked:

| I'm fine with this patch applied or not, but this driver is too big.
| It has a lot of unused struct members, I'm not sure they'll be used
| in the future, though.

Can you please comment on this? Is this stuff indeed provisions for later extensions that you have in your queue, or is it dead code that can be removed?

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I'd like to meet the man who invented sex and see what  he's  working
on now.
#4 lore raw

PATCH 1/1 Canyonlands SATA harddisk driver

Hello,

The SATA harddisk driver is based on the Linux kernel source code. Therefore, the software structure is the same structure as the Linux kernel driver.

DMA function was scheduled to be developed as my schedule. However, the development of the DMA function is discontinued once now. The structure of the register that controls DMA has not been used any longer. I will e-mail the source code ( removed the struct of DMA register ) later.

Regards,
Kazuaki Ichinohe

2009/5/29 Wolfgang Denk <[email protected]>:

Quoted 28 lines

Dear Kazuaki Ichinohe,

Quoted 3 lines · In message <[email protected]> you wrote:

This patch adds a SATA harddisk driver for the canyonlands. This patch is kernel driver's porting.
This pach corresponded to not cmd_scsi but cmd_sata.

Stefan Roese acked your patch, but then Shinya Kuribayashi remarked:

| I'm fine with this patch applied or not, but this driver is too big.
| It has a lot of unused struct members, I'm not sure they'll be used
| in the future, though.

Can you please comment on this? Is this stuff indeed provisions for later extensions that you have in your queue, or is it dead code that can be removed?

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, ? ? MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de I'd like to meet the man who invented sex and see what ?he's ?working on now.

#5 lore raw

PATCH 1/1 Canyonlands SATA harddisk driver

Quoted 4 lines · Kazuaki Ichinohe

DMA function was scheduled to be developed as my schedule. However, the development of the DMA function is discontinued once now. The structure of the register that controls DMA has not been used any longer. I will e-mail the source code ( removed the struct of DMA register ) later.

Please make sure I'm not talking about register definition structures. They're harmless, and no need to be cleaned up.

But, other local, private, resource management structures are encouraged to be shrinked/optimized, as it's just waste of ROM space.

Signature · 2 lines
Shinya Kuribayashi
NEC Electronics
#6 lore raw

PATCH 1/1 Canyonlands SATA harddisk driver

Hello Kuribayashi-san,

Quoted 2 lines

Please make sure I'm not talking about register definition structures. They're harmless, and no need to be cleaned up.

The definition of the register of DMA is the following.
However, the structure is used a little for the usage in which DMA is disabled.

struct dmareg {
	u32 low;
	u32 high;
};
struct dma_chan_regs {
	struct dmareg sar;
	struct dmareg dar;
	struct dmareg llp;
	struct dmareg ctl;
	struct dmareg sstat;
	struct dmareg dstat;
	struct dmareg sstatar;
	struct dmareg dstatar;
	struct dmareg cfg;
	struct dmareg sgr;
	struct dmareg dsr;
};
struct dma_interrupt_regs {
	struct dmareg tfr;
	struct dmareg block;
	struct dmareg srctran;
	struct dmareg dsttran;
	struct dmareg error;
};
struct ahb_dma_regs {
	struct dma_chan_regs		chan_regs[DMA_NUM_CHAN_REGS];
	struct dma_interrupt_regs		interrupt_raw;
	struct dma_interrupt_regs		interrupt_status;
	struct dma_interrupt_regs		interrupt_mask;
	struct dma_interrupt_regs		interrupt_clear;
	struct dmareg			statusInt;
	struct dmareg			rq_srcreg;
	struct dmareg			rq_dstreg;
	struct dmareg			rq_sgl_srcreg;
	struct dmareg			rq_sgl_dstreg;
	struct dmareg			rq_lst_srcreg;
	struct dmareg			rq_lst_dstreg;
	struct dmareg			dma_cfg;
	struct dmareg			dma_chan_en;
	struct dmareg			dma_id;
	struct dmareg			dma_test;
	struct dmareg			res1;
	struct dmareg			res2;
	/* DMA Comp Params
	 * Param 6 = dma_param[0], Param 5 = dma_param[1],
	 * Param 4 = dma_param[2] ...
	 */
	struct dmareg			dma_params[6];
};
Quoted 2 lines

But, other local, private, resource management structures are encouraged to be shrinked/optimized, as it's just waste of ROM space.

Originally U-boot of PowerPC is not importance for the size because the size is large. I will point out and object about you.
It is important to maintain interchangeability with the Linux kernel driver. It is important that maintenance is good.

Regards,
Kazuaki Ichinohe

Quoted 14 lines · Shinya Kuribayashi
Quoted 6 lines · Kazuaki Ichinohe

DMA function was scheduled to be developed as my schedule. However, the development of the DMA function is discontinued once now. The structure of the register that controls DMA has not been used any longer.
I will e-mail the source code ( removed the struct of DMA register ) later.

Please make sure I'm not talking about register definition structures. They're harmless, and no need to be cleaned up.

But, other local, private, resource management structures are encouraged to be shrinked/optimized, as it's just waste of ROM space.

#12 lore raw

PATCH 1/1 Canyonlands SATA harddisk driver

In reply to Shinya Kuribayashi
Quoted 11 lines · Shinya Kuribayashi
Quoted 4 lines · Kazuaki Ichinohe

DMA function was scheduled to be developed as my schedule. However, the development of the DMA function is discontinued once now. The structure of the register that controls DMA has not been used any longer. I will e-mail the source code ( removed the struct of DMA register ) later.

Please make sure I'm not talking about register definition structures. They're harmless, and no need to be cleaned up.

But, other local, private, resource management structures are encouraged to be shrinked/optimized, as it's just waste of ROM space.

if we remove it from the source, it will be harder to integrate upgrade on both side.

As done for the nand and ubi add ifndef __U_BOOT__ will allow to reduce the size impact without the integration difficult

Best Regards,
J.

#7 lore raw

PATCH 1/1 Canyonlands SATA harddisk driver

In reply to Kazuaki Ichinohe
Quoted 5 lines · Kazuaki Ichinohe
Quoted 2 lines

But, other local, private, resource management structures are encouraged to be shrinked/optimized, as it's just waste of ROM space.

Originally U-boot of PowerPC is not importance for the size because the size is large. I will point out and object about you.

As said before, I'm fine with this driver as is. I've just pointed out it has bunch of unused struct members in it.

Quoted 2 lines

It is important to maintain interchangeability with the Linux kernel driver. It is important that maintenance is good.

Hm, I don't see any good aspects with doing so, but that's also fine with me.

Signature · 2 lines
Shinya Kuribayashi
NEC Electronics
#8 lore raw

PATCH 1/1 Canyonlands SATA harddisk driver

Kuribayashi-san,

Do you think that you should include the Acked SATA driver in merge window of the next release (2009/08 or -09?)? I want to open the ACKed SATA driver to the public to the CanyonLands user.

Regards,
Kazuaki Ichinohe

#9 lore raw

PATCH 1/1 Canyonlands SATA harddisk driver

Quoted 2 lines · Kazuaki Ichinohe

Do you think that you should include the Acked SATA driver in merge window of the next release (2009/08 or -09?)? I want to open the ACKed SATA driver to the public to the CanyonLands user.

You won't need to worry about getting this driver merged into the next release. Wolfgang or Stefan will help guide you, and I'll not nitpick any more.

Signature · 2 lines
Shinya Kuribayashi
NEC Electronics
#10 lore raw

PATCH 1/1 Canyonlands SATA harddisk driver

Quoted 8 lines · On Thursday 04 June 2009 08:30:42 Shinya Kuribayashi wrote:
Quoted 3 lines · Kazuaki Ichinohe

Do you think that you should include the Acked SATA driver in merge window of the next release (2009/08 or -09?)? I want to open the ACKed SATA driver to the public to the CanyonLands user.

You won't need to worry about getting this driver merged into the next release. Wolfgang or Stefan will help guide you, and I'll not nitpick any more.

I already Acked the driver, so I'm fine with inclusion.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================

#11 lore raw

PATCH 1/1 Canyonlands SATA harddisk driver

In reply to Kazuaki Ichinohe

Dear Kazuaki Ichinohe,

In message <[email protected]> you wrote:
...

Quoted 4 lines
Quoted 2 lines

But, other local, private, resource management structures are encouraged to be shrinked/optimized, as it's just waste of ROM space.

Originally U-boot of PowerPC is not importance for the size because the size is large.

Size *is* important. Please read the docs - it's pointed out again and again.

Quoted 2 lines

It is important to maintain interchangeability with the Linux kernel driver. It is important that maintenance is good.

Agreed.

But we can easily disable / #define out unused parts of the code and data structures as Jean-Christophe suggested, without adding any significant maintenance problems.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Men will always be men -- no matter where they are.
	-- Harry Mudd, "Mudd's Women", stardate 1329.8