Skip to contentSkip to conversation

Add Highbank platform

PATCH Superseded Rob Herring 4 participants 10 messages Jun 21, 2011 – Sep 6, 2011 1 message not in the archive

Subsystems (3)

v3 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v3 cover Add Highbank platform

From: Rob Herring <[email protected]>

This series enables non-PCI AHCI controllers and adds support for Calxeda Highbank platform which uses the AHCI changes. I've dropped my SDHCI changes as now there are 2 versions of "common SDHCI" code on the list and that needs sorting out.

Wolfgang, Albert,

Are there any more comments on these patches? If not, can you apply these to your trees for v2011.09?

Rob

Rob Herring (5):
ARM: Add Calxeda Highbank platform
arm: add __ilog2 function
scsi/ahci: ata id little endian fix
scsi/ahci: add support for non-PCI controllers
ARM: highbank: Add AHCI support

 arch/arm/cpu/armv7/highbank/Makefile  |   46 ++++++++++++
 arch/arm/cpu/armv7/highbank/config.mk |    4 +
 arch/arm/cpu/armv7/highbank/timer.c   |  124 +++++++++++++++++++++++++++++++++
 arch/arm/include/asm/bitops.h         |    9 +++
 board/highbank/Makefile               |   49 +++++++++++++
 board/highbank/highbank.c             |   58 +++++++++++++++
 boards.cfg                            |    1 +
 common/cmd_scsi.c                     |    6 +-
 drivers/block/ahci.c                  |   72 ++++++++++++++++---
 include/ahci.h                        |    4 +
 include/configs/highbank.h            |  112 +++++++++++++++++++++++++++++
 include/scsi.h                        |    1 +
 12 files changed, 474 insertions(+), 12 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/highbank/Makefile
 create mode 100644 arch/arm/cpu/armv7/highbank/config.mk
 create mode 100644 arch/arm/cpu/armv7/highbank/timer.c
 create mode 100644 board/highbank/Makefile
 create mode 100644 board/highbank/highbank.c
 create mode 100644 include/configs/highbank.h
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH v3 1/5 ARM: Add Calxeda Highbank platform

From: Rob Herring <[email protected]>

Add basic support for Calxeda Highbank platform. Only minimal support to boot is included.

---
 arch/arm/cpu/armv7/highbank/Makefile  |   46 ++++++++++++
 arch/arm/cpu/armv7/highbank/config.mk |    4 +
 arch/arm/cpu/armv7/highbank/timer.c   |  124 +++++++++++++++++++++++++++++++++
 board/highbank/Makefile               |   49 +++++++++++++
 board/highbank/highbank.c             |   49 +++++++++++++
 boards.cfg                            |    1 +
 include/configs/highbank.h            |  101 +++++++++++++++++++++++++++
 7 files changed, 374 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/highbank/Makefile
 create mode 100644 arch/arm/cpu/armv7/highbank/config.mk
 create mode 100644 arch/arm/cpu/armv7/highbank/timer.c
 create mode 100644 board/highbank/Makefile
 create mode 100644 board/highbank/highbank.c
 create mode 100644 include/configs/highbank.h
arch/arm/cpu/armv7/highbank/Makefile new file +46 -0
new file mode 100644
index 0000000..76faeb0
@@ -0,0 +1,46 @@
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(SOC).o
+
+COBJS	:= timer.o
+SOBJS	:=
+
+SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
+
+all:	$(obj).depend $(LIB)
+
+$(LIB):	$(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
arch/arm/cpu/armv7/highbank/config.mk new file +4 -0
new file mode 100644
index 0000000..5ed5c39
@@ -0,0 +1,4 @@
+STANDALONE_LOAD_ADDR = 0x100000
+
+PLATFORM_CPPFLAGS += -march=armv7-a
+
arch/arm/cpu/armv7/highbank/timer.c new file +124 -0

124 lines not on this page · raw message

board/highbank/Makefile new file +49 -0

49 lines not on this page · raw message

board/highbank/highbank.c new file +49 -0

49 lines not on this page · raw message

boards.cfg +1 -0
index d2cacc8..7395d9c 100644
@@ -126,6 +126,7 @@ omap5912osk                  arm         arm926ejs   -                   ti
 edminiv2                     arm         arm926ejs   -                   LaCie          orion5x
 dkb			     arm         arm926ejs   -                   Marvell        pantheon
 ca9x4_ct_vxp                 arm         armv7       vexpress            armltd
+highbank                     arm         armv7       highbank            -              highbank
 efikamx                      arm         armv7       efikamx             -              mx5		mx51evk:IMX_CONFIG=board/efikamx/imximage.cfg
 mx51evk                      arm         armv7       mx51evk             freescale      mx5		mx51evk:IMX_CONFIG=board/freescale/mx51evk/imximage.cfg
 mx53evk                      arm         armv7       mx53evk             freescale      mx5		mx53evk:IMX_CONFIG=board/freescale/mx53evk/imximage.cfg
include/configs/highbank.h new file +101 -0

101 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#4 lore raw

PATCH v3 2/5 arm: add __ilog2 function

In reply to Rob Herring

From: Rob Herring <[email protected]>

Add __ilog2 function for ARM. Needed for ahci.c

Cc Albert ARIBAUD <[email protected]>
---
 arch/arm/include/asm/bitops.h |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
arch/arm/include/asm/bitops.h +9 -0
index 270f163..0420182 100644
@@ -106,6 +106,15 @@ static inline int test_bit(int nr, const void * addr)
     return ((unsigned char *) addr)[nr >> 3] & (1U << (nr & 7));
 }
 
+extern __inline__ int __ilog2(unsigned int x)
+{
+	int ret;
+
+	asm("clz\t%0, %1" : "=r" (ret) : "r" (x));
+	ret = 31 - ret;
+	return ret;
+}
+
 /*
  * ffz = Find First Zero in word. Undefined if no zero exists,
  * so code should check against ~0UL first..
Signature · 1 line
1.7.4.1
#5 lore raw

PATCH v3 3/5 scsi/ahci: ata id little endian fix

In reply to Rob Herring

From: Rob Herring <[email protected]>

The ata id string always needs swapping, not just on BE machines.

---
 drivers/block/ahci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/block/ahci.c +1 -1
index a3ca2dc..d431c5a 100644
@@ -468,7 +468,7 @@ static char *ata_id_strcpy(u16 *target, u16 *src, int len)
 {
 	int i;
 	for (i = 0; i < len / 2; i++)
-		target[i] = le16_to_cpu(src[i]);
+		target[i] = swab16(src[i]);
 	return (char *)target;
 }
 
Signature · 1 line
1.7.4.1
#9 lore raw

PATCH v3 4/5 scsi/ahci: add support for non-PCI controllers

In reply to Rob Herring

From: Rob Herring <[email protected]>

Add support for AHCI controllers that are not PCI based.

---
 common/cmd_scsi.c    |    6 +++-
 drivers/block/ahci.c |   70 +++++++++++++++++++++++++++++++++++++++++++------
 include/ahci.h       |    4 +++
 include/scsi.h       |    1 +
 4 files changed, 70 insertions(+), 11 deletions(-)
common/cmd_scsi.c +4 -2
index be4fe74..25a8299 100644
@@ -47,7 +47,8 @@
 #define SCSI_DEV_ID  0x5288
 
 #else
-#error no scsi device defined
+#define SCSI_VEND_ID 0
+#define SCSI_DEV_ID  0
 #endif
 
 
@@ -174,7 +175,7 @@ removable:
 		scsi_curr_dev = -1;
 }
 
-
+#ifdef CONFIG_PCI
 void scsi_init(void)
 {
 	int busdevfunc;
@@ -192,6 +193,7 @@ void scsi_init(void)
 	scsi_low_level_init(busdevfunc);
 	scsi_scan(1);
 }
+#endif
 
 block_dev_desc_t * scsi_get_dev(int dev)
 {
drivers/block/ahci.c +61 -9

149 lines not on this page · raw message

include/ahci.h +4 -0
index 0c6bbbd..c0a0a47 100644
@@ -25,6 +25,8 @@
 #ifndef _AHCI_H_
 #define _AHCI_H_
 
+#include <pci.h>
+
 #define AHCI_PCI_BAR		0x24
 #define AHCI_MAX_SG		56 /* hardware max is 64K */
 #define AHCI_CMD_SLOT_SZ	32
@@ -187,4 +189,6 @@ struct ahci_probe_ent {
 	u32	link_port_map; /*linkup port map*/
 };
 
+int ahci_init(u32 base);
+ 
 #endif
include/scsi.h +1 -0
index aaafc9c..c52759c 100644
@@ -185,6 +185,7 @@ void scsi_low_level_init(int busdevfunc);
  * functions residing inside cmd_scsi.c
  */
 void scsi_init(void);
+void scsi_scan(int mode);
 
 
 #define SCSI_IDENTIFY					0xC0  /* not used */
Signature · 1 line
1.7.4.1
#10 lore raw

PATCH v3 5/5 ARM: highbank: Add AHCI support

In reply to Rob Herring

From: Rob Herring <[email protected]>

This enables the AHCI driver on highbank platforms.

Cc Wolfgang Denk <[email protected]>
Cc Albert ARIBAUD <[email protected]>
---
 board/highbank/highbank.c  |    9 +++++++++
 include/configs/highbank.h |   11 +++++++++++
 2 files changed, 20 insertions(+), 0 deletions(-)
board/highbank/highbank.c +9 -0
index 9a0fc19..bec3d2f 100644
@@ -16,6 +16,8 @@
  */
 
 #include <common.h>
+#include <ahci.h>
+#include <scsi.h>
 
 #include <asm/sizes.h>
 
@@ -31,6 +33,13 @@ int board_init(void)
 	return 0;
 }
 
+int misc_init_r(void)
+{
+	ahci_init(0xffe08000);
+	scsi_scan(1);
+	return 0;
+}
+
 int dram_init(void)
 {
 	gd->ram_size = SZ_512M;
include/configs/highbank.h +11 -0
index 6e26848..0ae198d 100644
@@ -41,6 +41,15 @@
 #define CONFIG_BAUDRATE			38400
 #define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, 115200 }
 
+#define CONFIG_MISC_INIT_R
+#define CONFIG_SCSI_AHCI
+#define CONFIG_SYS_SCSI_MAX_SCSI_ID	5
+#define CONFIG_SYS_SCSI_MAX_LUN		1
+#define CONFIG_SYS_SCSI_MAX_DEVICE	(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
+					CONFIG_SYS_SCSI_MAX_LUN)
+
+#define CONFIG_DOS_PARTITION
+
 /*
  * Command line configuration.
  */
@@ -52,6 +61,8 @@
 #define CONFIG_CMD_ELF
 #define CONFIG_CMD_MEMORY
 #define CONFIG_CMD_LOADS
+#define CONFIG_CMD_SCSI
+#define CONFIG_CMD_EXT2
 
 #define CONFIG_BOOTDELAY		2
 /*
Signature · 1 line
1.7.4.1
#2 lore raw

PATCH 1/5 ARM: Add Calxeda Highbank platform

In reply to Rob Herring
Quoted 8 lines · Rob Herring

From: Rob Herring <[email protected]>

Add basic support for Calxeda Highbank platform. Only minimal support to boot is included.

Quoted 8 lines

---

?arch/arm/cpu/armv7/highbank/Makefile ?| ? 46 ++++++++++++
?arch/arm/cpu/armv7/highbank/config.mk | ? ?4 +
?arch/arm/cpu/armv7/highbank/timer.c ? | ?124 +++++++++++++++++++++++++++++++++
?board/highbank/Makefile ? ? ? ? ? ? ? | ? 49 +++++++++++++
?board/highbank/highbank.c ? ? ? ? ? ? | ? 49 +++++++++++++
?boards.cfg ? ? ? ? ? ? ? ? ? ? ? ? ? ?| ? ?1 +
?include/configs/highbank.h ? ? ? ? ? ?| ?101 +++++++++++++++++++++++++++

You should add an entry to MAINTAINERS file.
...

board/highbank/highbank.c

Quoted 3 lines
board/highbank/highbank.c new file +3 -0
+int dram_init(void)
+{
+ ? ? ? gd->ram_size = SZ_512M;

You could use
gd->ram_size = get_ram_size((volatile void *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE);

Regards,

Fabio Estevam

#3 lore raw

PATCH v3 1/5 ARM: Add Calxeda Highbank platform

Quoted 21 lines · Fabio Estevam
Quoted 8 lines · Rob Herring

From: Rob Herring <[email protected]>

Add basic support for Calxeda Highbank platform. Only minimal support to boot is included.

Quoted 8 lines
---
 arch/arm/cpu/armv7/highbank/Makefile  |   46 ++++++++++++
 arch/arm/cpu/armv7/highbank/config.mk |    4 +
 arch/arm/cpu/armv7/highbank/timer.c   |  124 +++++++++++++++++++++++++++++++++
 board/highbank/Makefile               |   49 +++++++++++++
 board/highbank/highbank.c             |   49 +++++++++++++
 boards.cfg                            |    1 +
 include/configs/highbank.h            |  101 +++++++++++++++++++++++++++

You should add an entry to MAINTAINERS file.
...

Quoted 6 lines

board/highbank/highbank.c line 36

Quoted 3 lines
board/highbank/highbank.c new file +3 -0
+int dram_init(void)
+{
+       gd->ram_size = SZ_512M;

You could use
gd->ram_size = get_ram_size((volatile void *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE);

Except that does not work on qemu, and qemu can't model all of ram. So I need to limit the ram size, but have the same image work on h/w and qemu.

Rob

#6 lore raw

PATCH 3/5 scsi/ahci: ata id little endian fix

In reply to Rob Herring

Dear Rob Herring,

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

From: Rob Herring <[email protected]>

The ata id string always needs swapping, not just on BE machines.

---
 drivers/block/ahci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 7 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
You go slow, be gentle. It's no one-way street -- you  know  how  you
feel and that's all. It's how the girl feels too. Don't press. If the
girl feels anything for you at all, you'll know.
	-- Kirk, "Charlie X", stardate 1535.8
#8 lore raw

PATCH 3/5 scsi/ahci: ata id little endian fix

In reply to a message not in the archive
Quoted 35 lines · On Tue, Sep 6, 2011 at 12:07 PM, <[email protected]> wrote:

---------- Forwarded message ----------
From: Rob Herring <[email protected]>
Date: Tue, Jun 21, 2011 at 2:33 PM
Subject: [U-Boot] [PATCH 3/5] scsi/ahci: ata id little endian fix
To: u-boot at lists.denx.de
Cc: Rob Herring <[email protected]>

From: Rob Herring <[email protected]>

The ata id string always needs swapping, not just on BE machines.

---
 drivers/block/ahci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/block/ahci.c +1 -2
index a3ca2dc..d431c5a 100644
@@ -468,7 +468,7 @@ static char *ata_id_strcpy(u16 *target, u16 *src, int
 len)
 {
       int i;
       for (i = 0; i < len / 2; i++)
-               target[i] = le16_to_cpu(src[i]);
+               target[i] = swab16(src[i]);
       return (char *)target;
 }
 
--

1.7.4.1

Quoted 6 lines

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

guys, I am looking into enabling the AHCI driver on the x86 platforms (working off an older version of drivers/block/ahci.c, but planning to reconcile).

One of my internal reviewers brought this up (and it seems quite a reasonable question): why does one need to swap bytes always, no matter the CPU endianness?

Also, can you please comment on what is going on in ata_scsiop_inquiry(), in particular, what are the contents of the hdr[] array? Any hints would be highly appreciated,

cheers,
/vb