Skip to contentSkip to conversation

RFC: Dreamplug support

PATCH Superseded u-boot at lakedaemon.net 8 participants 60 messages Jun 13, 2011 – Oct 7, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v4 cover RFC: Dreamplug support

From: Jason Cooper <[email protected]>

It compiles clean, and I've loaded it via JTAG and used it to dump the existing bootloader out of the SPI flash. I have _not_ used it to burn itself to the flash yet. I'm looking for comments before I try that. ;-)

Some concerns:

- The SPI flash chip is a Macronix MX25L1606, however it has the identical chip idcode to the MX25L1605. How is that properly handled? The 06 does have some new features [1].

[1] http://www.macronix.com/QuickPlace/hq/PageLibrary4825740B00298A3B.nsf/h_Index/5F41CDDCB837422C48257639003E5EC3/$File/AN055-Migrate_to_MX25L1606E_and_MX25L8006E-1.2.pdf

Changes from v1 to v2:

- resorted series to move 'make all' support last.

Changes from v2 to v3:

- Use MACH_TYPE_GURUPLUG for now until dreamplug support is in Linux.
- Update MAINTAINERS.
- Collapse into one patch.

Changes from v3 to v4:

- update copyright info as recommended by Prafulla Wadaskar.
- maintain proper order in boards.cfg, MAINTAINERS, etc.
- label MPP's
- change back to MACH_TYPE_DREAMPLUG. This patch is just RFC until the Dreamplug is supported in Linux (and MACH_TYPE_ added).

Jason Cooper (1):
dreamplug: Initial support.

 MAINTAINERS                          |    4 +
 MAKEALL                              |    1 +
 board/Marvell/dreamplug/Makefile     |   54 +++++++++++
 board/Marvell/dreamplug/dreamplug.c  |  157 ++++++++++++++++++++++++++++++++
 board/Marvell/dreamplug/dreamplug.h  |   42 +++++++++
 board/Marvell/dreamplug/kwbimage.cfg |  163 ++++++++++++++++++++++++++++++++++
 boards.cfg                           |    1 +
 include/configs/dreamplug.h          |  114 ++++++++++++++++++++++++
 8 files changed, 536 insertions(+), 0 deletions(-)
 create mode 100644 board/Marvell/dreamplug/Makefile
 create mode 100644 board/Marvell/dreamplug/dreamplug.c
 create mode 100644 board/Marvell/dreamplug/dreamplug.h
 create mode 100644 board/Marvell/dreamplug/kwbimage.cfg
 create mode 100644 include/configs/dreamplug.h
#1 lore raw

PATCH v4 1/1 RFC: dreamplug: Initial support.

From: Jason Cooper <[email protected]>

Copied files from boards/Marvell/guruplug/ and did
s/GURUPLUG/DREAMPLUG/g s/guruplug/dreamplug/g

Switched from NAND flash to SPI flash.

	MPP._SPI_ configuration copied from
	boards/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c

Also, MACH_TYPE_DREAMPLUG (board id 3550) has been registered at
http://www.arm.linux.co.uk/developer/machines/.

---
 MAINTAINERS                          |    4 +
 MAKEALL                              |    1 +
 board/Marvell/dreamplug/Makefile     |   54 +++++++++++
 board/Marvell/dreamplug/dreamplug.c  |  157 ++++++++++++++++++++++++++++++++
 board/Marvell/dreamplug/dreamplug.h  |   42 +++++++++
 board/Marvell/dreamplug/kwbimage.cfg |  163 ++++++++++++++++++++++++++++++++++
 boards.cfg                           |    1 +
 include/configs/dreamplug.h          |  114 ++++++++++++++++++++++++
 8 files changed, 536 insertions(+), 0 deletions(-)
 create mode 100644 board/Marvell/dreamplug/Makefile
 create mode 100644 board/Marvell/dreamplug/dreamplug.c
 create mode 100644 board/Marvell/dreamplug/dreamplug.h
 create mode 100644 board/Marvell/dreamplug/kwbimage.cfg
 create mode 100644 include/configs/dreamplug.h
MAINTAINERS +4 -0
index c462ae2..9422c7e 100644
@@ -70,6 +70,10 @@ Conn Clark <[email protected]>
 
 	ESTEEM192E	MPC8xx
 
+Jason Cooper <[email protected]>
+
+	dreamplug	ARM926EJS (Kirkwood SoC)
+
 Joe D'Abbraccio <[email protected]>
 
 	MPC837xERDB	MPC837x
MAKEALL +1 -0
index d592374..b17b46d 100755
@@ -335,6 +335,7 @@ LIST_ARM9="			\
 	cp966			\
 	da830evm		\
 	da850evm		\
+	dreamplug		\
 	edb9301			\
 	edb9302			\
 	edb9302a		\
board/Marvell/dreamplug/Makefile new file +54 -0

54 lines not on this page · raw message

board/Marvell/dreamplug/dreamplug.c new file +157 -0

157 lines not on this page · raw message

board/Marvell/dreamplug/dreamplug.h new file +42 -0

42 lines not on this page · raw message

board/Marvell/dreamplug/kwbimage.cfg new file +163 -0

163 lines not on this page · raw message

boards.cfg +1 -0
index d2cacc8..f42aba0 100644
@@ -109,6 +109,7 @@ davinci_sonata               arm         arm926ejs   sonata              davinci
 suen3                        arm         arm926ejs   km_arm              keymile        kirkwood
 suen8                        arm         arm926ejs   km_arm              keymile        kirkwood
 mgcoge3un                    arm         arm926ejs   km_arm              keymile        kirkwood
+dreamplug                    arm         arm926ejs   -                   Marvell        kirkwood
 guruplug                     arm         arm926ejs   -                   Marvell        kirkwood
 mv88f6281gtw_ge              arm         arm926ejs   -                   Marvell        kirkwood
 openrd_base                  arm         arm926ejs   openrd              Marvell        kirkwood        openrd:BOARD_IS_OPENRD_BASE
include/configs/dreamplug.h new file +114 -0

114 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#2 lore raw

PATCH v4 1/1 RFC: dreamplug: Initial support.

Quoted 15 lines

-----Original Message-----
From: u-boot at lakedaemon.net [mailto:u-boot at lakedaemon.net]
Sent: Monday, June 13, 2011 9:24 PM
To: u-boot at lists.denx.de
Cc: Prafulla Wadaskar; Siddarth Gore; Jason Cooper
Subject: [PATCH 1/1 v4] RFC: dreamplug: Initial support.

From: Jason Cooper <[email protected]>

Copied files from boards/Marvell/guruplug/ and did
s/GURUPLUG/DREAMPLUG/g s/guruplug/dreamplug/g

Quoted 7 lines

Switched from NAND flash to SPI flash.

	MPP._SPI_ configuration copied from
	boards/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c

Also, MACH_TYPE_DREAMPLUG (board id 3550) has been registered at
http://www.arm.linux.co.uk/developer/machines/.

Since you have only one patch in the series you can avoid 0/1 for your next posts.

I will post review comments latter

Regards..
Prafulla . .

author
#3 lore raw

PATCH v4 1/1 RFC: dreamplug: Initial support.

Quoted 18 lines · Prafulla Wadaskar
Quoted 18 lines

-----Original Message-----
From: u-boot at lakedaemon.net [mailto:u-boot at lakedaemon.net]
Sent: Monday, June 13, 2011 9:24 PM
To: u-boot at lists.denx.de
Cc: Prafulla Wadaskar; Siddarth Gore; Jason Cooper
Subject: [PATCH 1/1 v4] RFC: dreamplug: Initial support.

From: Jason Cooper <[email protected]>

Copied files from boards/Marvell/guruplug/ and did
s/GURUPLUG/DREAMPLUG/g s/guruplug/dreamplug/g

Switched from NAND flash to SPI flash.

	MPP._SPI_ configuration copied from
	boards/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c
Quoted 6 lines
Quoted 3 lines

Also, MACH_TYPE_DREAMPLUG (board id 3550) has been registered at
http://www.arm.linux.co.uk/developer/machines/.

Since you have only one patch in the series you can avoid 0/1 for your next posts.

Ok, I was just trying to keep submission comments separate from commit messages. Is there a better way to do that?

Quoted 2 lines

I will post review comments latter

Thanks,

Jason

#4 lore raw

PATCH v4 1/1 RFC: dreamplug: Initial support.

Dear Jason,

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

Ok, I was just trying to keep submission comments separate from commit messages. Is there a better way to do that?

Please add them to the comment section, i. e. below the "---" line. This is MUCH better, because then they also show up in patchwork, which is not the case with a separate cover letter message.

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
Unix: Some say the learning curve is steep,  but  you  only  have  to
climb it once.                                      - Karl Lehenbauer
author
#5 lore raw

PATCH v4 1/1 RFC: dreamplug: Initial support.

Quoted 11 lines · Wolfgang Denk

Dear Jason,

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

Ok, I was just trying to keep submission comments separate from commit messages. Is there a better way to do that?

Please add them to the comment section, i. e. below the "---" line. This is MUCH better, because then they also show up in patchwork, which is not the case with a separate cover letter message.

Ahhh, thanks for the clarification. I'll make sure to do that if there needs to be another revision, or once Linux support is mainlined and I'm submitting for inclusion.

thx,

Jason.

#6 lore raw

PATCH v4 1/1 RFC: dreamplug: Initial support.

Quoted 3 lines · Jason

Ahhh, thanks for the clarification. I'll make sure to do that if there needs to be another revision, or once Linux support is mainlined and I'm submitting for inclusion.

What's the current state of this?

Thanks.

author
#7 lore raw

PATCH v4 1/1 RFC: dreamplug: Initial support.

Quoted 6 lines · Clint Adams
Quoted 3 lines · Jason

Ahhh, thanks for the clarification. I'll make sure to do that if there needs to be another revision, or once Linux support is mainlined and I'm submitting for inclusion.

What's the current state of this?

Dead. GlobalScale/Marvell refuse to release the u-boot source code, and the ARM maintainers of Linux aren't accepting new board code until they unfsck their tree.

So the chance of doing it properly (new board id, proper MPP config, etc) is slim to none.

The kernel shipped with the Dreamplug is apparently the exact same one as in the Guruplug. The Dreamplug u-boot even uses the guruplug board-id, despite having a totally different flash chip on a different bus. The Dreamplug/Guruplug kernel has absolutely no support for the SPI flash chip compiled in. Despite the fact that the driver is already in mainline...

I've had it working, but suffering random oopses and crashes. I believe this is due to me guessing at the MPP config (based on other Marvell boards with same processor / flash chip). But I'm shooting in the dark unless I see the source code to u-boot.

It's a shame, because they finally solved the overheating issues.

hth,

Jason.

#8 lore raw

PATCH v4 1/1 RFC: dreamplug: Initial support.

Quoted 4 lines · Jason

I've had it working, but suffering random oopses and crashes. I believe this is due to me guessing at the MPP config (based on other Marvell boards with same processor / flash chip). But I'm shooting in the dark unless I see the source code to u-boot.

This is from Globalscale. It's a git clone of u-boot-marvell from 2010, with a dirty working tree (patching the guruplug target to be a dreamplug).

http://people.debian.org/~clint/dreamplug/dreamplug-uboot-gti.tar.gz

I hope this helps.

author
#9 lore raw

PATCH v4 1/1 RFC: dreamplug: Initial support.

Quoted 6 lines · Clint Adams
Quoted 4 lines · Jason

I've had it working, but suffering random oopses and crashes. I believe this is due to me guessing at the MPP config (based on other Marvell boards with same processor / flash chip). But I'm shooting in the dark unless I see the source code to u-boot.

Quoted 6 lines

This is from Globalscale. It's a git clone of u-boot-marvell from 2010, with a dirty working tree (patching the guruplug target to be a dreamplug).

http://people.debian.org/~clint/dreamplug/dreamplug-uboot-gti.tar.gz

I hope this helps.

Awesome! Thanks! I didn't even know about the rtc driver. iirc, most of the kernel oopses involved rtc stuff. I'll take a more detailed look later, have to fix the file permissions first. They must've had it on a windows system. Everything is executable. :-(

$ for fn in `git diff --name-only`; do chmod -x "$fn"; done

fixed it right up. I'll import this into my tree and see if I can get a running system.

Thanks again,

Jason.

#10 lore raw

[U-Boot] RFC [PATCH 0/5 v5] add dreamplug support

In reply to u-boot at lakedaemon.net

All,

This is a complete redo from v4. I received a copy of the u-boot source code GlobalScale used in the Dreamplug. This series is a mix of my code and theirs.

Patches 1 and 2 add features to boards using the kirkwood arch. I think. I have no way to test it on guruplug/sheevaplug/etc. They work on dreamplug, though.

Patch 3 increases the timeout for slow-to-respond EHCI chips, like that found in the dreamplug. It may help other places. If it's non-harmful, it can also be applied separately.

Patch 4 adds the dreamplug support. It uses the spi flash, boots from it, writes the environment to it, etc. It also enables and uses patches 1 and 2.

Patch 5 is for once the dreamplug machid and board support are added to the mailine Linux kernel.

Jason Cooper (5):
drivers/rtc: add Marvell Integrated RTC.
arm/kirkwood: print speeds with cpu info.
usb: Some EHCI chipsets are slow to respond.
dreamplug: initial board support.
dreamplug: use MACH_TYPE_DREAMPLUG

 MAINTAINERS                              |    4 +
 MAKEALL                                  |    1 +
 arch/arm/cpu/arm926ejs/kirkwood/cpu.c    |   46 +++++++++
 arch/arm/include/asm/arch-kirkwood/cpu.h |    1 +
 board/Marvell/dreamplug/Makefile         |   54 ++++++++++
 board/Marvell/dreamplug/dreamplug.c      |  154 ++++++++++++++++++++++++++++
 board/Marvell/dreamplug/dreamplug.h      |   42 ++++++++
 board/Marvell/dreamplug/kwbimage.cfg     |  163 ++++++++++++++++++++++++++++++
 boards.cfg                               |    1 +
 drivers/rtc/Makefile                     |    1 +
 drivers/rtc/mvinteg_rtc.c                |  151 +++++++++++++++++++++++++++
 drivers/rtc/mvinteg_rtc.h                |   89 ++++++++++++++++
 include/configs/dreamplug.h              |  138 +++++++++++++++++++++++++
 include/usb.h                            |    2 +-
 14 files changed, 846 insertions(+), 1 deletions(-)
 create mode 100644 board/Marvell/dreamplug/Makefile
 create mode 100644 board/Marvell/dreamplug/dreamplug.c
 create mode 100644 board/Marvell/dreamplug/dreamplug.h
 create mode 100644 board/Marvell/dreamplug/kwbimage.cfg
 create mode 100644 drivers/rtc/mvinteg_rtc.c
 create mode 100644 drivers/rtc/mvinteg_rtc.h
 create mode 100644 include/configs/dreamplug.h
#11 lore raw

PATCH v6 1/1 dreamplug: initial board support.

From: Jason Cooper <[email protected]>

Copied wholeheartedly from board/Marvell/guruplug and modified to add support for SPI NOR flash.

CONFIG_MACH_DREAMPLUG defined in include/configs/dreamplug.h until Linus's kernel.org tree adds it to mach-types.h. Once it trickles down, the definition can be removed from dreamplug.h.

---
Changes from v1 to v2:

- resorted series to move 'make all' support last.

Changes from v2 to v3:

- Use MACH_TYPE_GURUPLUG for now until dreamplug support is in Linux.
- Update MAINTAINERS.
- Collapse into one patch.

Changes from v3 to v4:

- update copyright info as recommended by Prafulla Wadaskar.
- maintain proper order in boards.cfg, MAINTAINERS, etc.
- label MPP's
- change back to MACH_TYPE_DREAMPLUG. This patch is just RFC until the Dreamplug is supported in Linux (and MACH_TYPE_ added).

Changes from v4 to v5:

- Complete rewrite due to receiving u-boot source indirectly from Global Scale Tech.
- Added driver for integrated RTC. (thx GST!)
- Added support for displaying CPU frequencies at boot. (thx GST!)
- Adjust USB timeout to handle dreamplug EHCI chipset.
- Cleaned up MPP registers based on Global Scale code. (thx GST!)
- broke out MACH_TYPE_DREAMPLUG changes since it's going to be a while until the Linux arm tree gets sorted and accepts new boards again. Since all Dreamplugs currently on the market set r1 to MACH_TYPE_GURUPLUG, this allows the board to be added to u-boot while waiting for Linux mainline. Once it's in Linux mainline, then the last patch can be integrated to use MACH_TYPE_DREAMPLUG.

Changes from v5 to v6:

- Define MACH_TYPE_DREAMPLUG in includes/configs/dreamplug.h until Linus's kernel.org tree includes assigned machine id. This is on Wolfgang's recommendation [1].
- Removed dcache disabling as it is no longer enabled by default.
- USB timeout fix was merged.
- Marvell Integrated RTC was merged.
- Dropped CPU frequency printout as I'm not familiar enough with all flavors of kirkwood SoCs to do it correctly.
- Labelled MPP*_GPIO pins that are broken out as gpio pins for the user.
- Fixed function name mv_phy_88e1121_init() -> mv_phy_88e1116_init().

[1] http://www.mail-archive.com/u-boot at lists.denx.de/msg60921.html

 MAINTAINERS                          |    4 +
 board/Marvell/dreamplug/Makefile     |   54 +++++++++++
 board/Marvell/dreamplug/dreamplug.c  |  154 ++++++++++++++++++++++++++++++++
 board/Marvell/dreamplug/dreamplug.h  |   42 +++++++++
 board/Marvell/dreamplug/kwbimage.cfg |  163 ++++++++++++++++++++++++++++++++++
 boards.cfg                           |    1 +
 include/configs/dreamplug.h          |  158 ++++++++++++++++++++++++++++++++
 7 files changed, 576 insertions(+), 0 deletions(-)
 create mode 100644 board/Marvell/dreamplug/Makefile
 create mode 100644 board/Marvell/dreamplug/dreamplug.c
 create mode 100644 board/Marvell/dreamplug/dreamplug.h
 create mode 100644 board/Marvell/dreamplug/kwbimage.cfg
 create mode 100644 include/configs/dreamplug.h
MAINTAINERS +4 -0
index 2f60a60..88d5637 100644
@@ -70,6 +70,10 @@ Conn Clark <[email protected]>
 
 	ESTEEM192E	MPC8xx
 
+Jason Cooper <[email protected]>
+
+	dreamplug	ARM926EJS (Kirkwood SoC)
+
 Joe D'Abbraccio <[email protected]>
 
 	MPC837xERDB	MPC837x
board/Marvell/dreamplug/Makefile new file +54 -0

54 lines not on this page · raw message

board/Marvell/dreamplug/dreamplug.c new file +154 -0

154 lines not on this page · raw message

board/Marvell/dreamplug/dreamplug.h new file +42 -0

42 lines not on this page · raw message

board/Marvell/dreamplug/kwbimage.cfg new file +163 -0

163 lines not on this page · raw message

boards.cfg +1 -0
index 8a5bfc1..cceda57 100644
@@ -135,6 +135,7 @@ portl2                       arm         arm926ejs   km_arm              keymile
 inetspace_v2                 arm         arm926ejs   netspace_v2         LaCie          kirkwood    netspace_v2:INETSPACE_V2
 netspace_v2                  arm         arm926ejs   netspace_v2         LaCie          kirkwood    netspace_v2:NETSPACE_V2
 netspace_max_v2              arm         arm926ejs   netspace_v2         LaCie          kirkwood    netspace_v2:NETSPACE_MAX_V2
+dreamplug                    arm         arm926ejs   -                   Marvell        kirkwood
 guruplug                     arm         arm926ejs   -                   Marvell        kirkwood
 mv88f6281gtw_ge              arm         arm926ejs   -                   Marvell        kirkwood
 openrd_base                  arm         arm926ejs   openrd              Marvell        kirkwood        openrd:BOARD_IS_OPENRD_BASE
include/configs/dreamplug.h new file +158 -0

158 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#12 lore raw

PATCH v6 1/1 dreamplug: initial board support.

Sorry for jumping in that late...

Quoted 11 lines · u-boot at lakedaemon.net

From: Jason Cooper <[email protected]>

Copied wholeheartedly from board/Marvell/guruplug and modified to add support for SPI NOR flash.

CONFIG_MACH_DREAMPLUG defined in include/configs/dreamplug.h until Linus's kernel.org tree adds it to mach-types.h. Once it trickles down, the definition can be removed from dreamplug.h.

---

[...]

Quoted 5 lines
board/Marvell/dreamplug/dreamplug.c new file +0 -0
new file mode 100644
index 0000000..cff3e9d

[...]

board/Marvell/dreamplug/dreamplug.c line 108

Quoted 5 lines
board/Marvell/dreamplug/dreamplug.c new file +5 -0
+
+int board_init(void)
+{
+	/* arch number of board */
+	gd->bd->bi_arch_number = MACH_TYPE_DREAMPLUG;

This should be done in the board config file.
Please, see the CONFIG_MACH_TYPE in the U-Boot documentation (README file).

[...]

Quoted 5 lines
include/configs/dreamplug.h new file +0 -0
new file mode 100644
index 0000000..003d201

[...]

Quoted 10 lines
include/configs/dreamplug.h new file +10 -0
+/*
+ * FIXME: This belongs in mach-types.h.  However, we only pull mach-types
+ * from Linus' kernel.org tree.  This hasn't been updated primarily due to
+ * the recent arch/arm reshuffling.  So, in the meantime, we'll place it
+ * here.
+ */
+#define MACH_TYPE_DREAMPLUG            3550
+
+#ifdef CONFIG_MACH_DREAMPLUG
+# ifdef machine_arch_type

include/configs/dreamplug.h line 50

Quoted 10 lines
include/configs/dreamplug.h new file +10 -0
+#  undef machine_arch_type
+#  define machine_arch_type	__machine_arch_type
+# else
+#  define machine_arch_type	MACH_TYPE_DREAMPLUG
+# endif
+# define machine_is_dreamplug()	(machine_arch_type == MACH_TYPE_DREAMPLUG)
+#else
+# define machine_is_dreamplug()	(0)
+#endif
+

#define CONFIG_MACH_TYPE MACH_TYPE_DREAMPLUG
should be added here... and should remain after you remove the above as in FIXME.

Signature · 2 lines
Regards,
Igor.
author
#13 lore raw

PATCH v6 1/1 dreamplug: initial board support.

Quoted 1 line · Igor Grinberg

Sorry for jumping in that late...

Well, it hasn't been merged yet, so it's not too late in my book. ;-)

Quoted 23 lines · u-boot at lakedaemon.net
Quoted 11 lines

From: Jason Cooper <[email protected]>

Copied wholeheartedly from board/Marvell/guruplug and modified to add support for SPI NOR flash.

CONFIG_MACH_DREAMPLUG defined in include/configs/dreamplug.h until Linus's kernel.org tree adds it to mach-types.h. Once it trickles down, the definition can be removed from dreamplug.h.

---

[...]

Quoted 5 lines
board/Marvell/dreamplug/dreamplug.c new file +0 -0
new file mode 100644
index 0000000..cff3e9d

[...]

Quoted 8 lines

board/Marvell/dreamplug/dreamplug.c line 108

Quoted 5 lines
board/Marvell/dreamplug/dreamplug.c new file +5 -0
+
+int board_init(void)
+{
+	/* arch number of board */
+	gd->bd->bi_arch_number = MACH_TYPE_DREAMPLUG;

This should be done in the board config file.
Please, see the CONFIG_MACH_TYPE in the U-Boot documentation (README file).

Will do, v7 cued up.

Quoted 26 lines

[...]

Quoted 5 lines
include/configs/dreamplug.h new file +0 -0
new file mode 100644
index 0000000..003d201

[...]

Quoted 16 lines
include/configs/dreamplug.h new file +16 -0
+/*
+ * FIXME: This belongs in mach-types.h.  However, we only pull mach-types
+ * from Linus' kernel.org tree.  This hasn't been updated primarily due to
+ * the recent arch/arm reshuffling.  So, in the meantime, we'll place it
+ * here.
+ */
+#define MACH_TYPE_DREAMPLUG            3550
+
+#ifdef CONFIG_MACH_DREAMPLUG
+# ifdef machine_arch_type
+#  undef machine_arch_type
+#  define machine_arch_type	__machine_arch_type
+# else
+#  define machine_arch_type	MACH_TYPE_DREAMPLUG
+# endif
+# define machine_is_dreamplug()	(machine_arch_type == MACH_TYPE_DREAMPLUG)
Quoted 8 lines

include/configs/dreamplug.h line 50

Quoted 4 lines
include/configs/dreamplug.h new file +4 -0
+#else
+# define machine_is_dreamplug()	(0)
+#endif
+

#define CONFIG_MACH_TYPE MACH_TYPE_DREAMPLUG
should be added here... and should remain after you remove the above as in FIXME.

Thanks for the review!

thx,

Jason.

#14 lore raw

PATCH v7 1/1 dreamplug: initial board support.

In reply to u-boot at lakedaemon.net

Copied wholeheartedly from board/Marvell/guruplug and modified to add support for SPI NOR flash.

CONFIG_MACH_DREAMPLUG defined in include/configs/dreamplug.h until Linus's kernel.org tree adds it to mach-types.h. Once it trickles down, the definition can be removed from dreamplug.h.

---
Changes from v1 to v2:

- resorted series to move 'make all' support last.

Changes from v2 to v3:

- Use MACH_TYPE_GURUPLUG for now until dreamplug support is in Linux.
- Update MAINTAINERS.
- Collapse into one patch.

Changes from v3 to v4:

- update copyright info as recommended by Prafulla Wadaskar.
- maintain proper order in boards.cfg, MAINTAINERS, etc.
- label MPP's
- change back to MACH_TYPE_DREAMPLUG. This patch is just RFC until the Dreamplug is supported in Linux (and MACH_TYPE_ added).

Changes from v4 to v5:

- Complete rewrite due to receiving u-boot source indirectly from Global Scale Tech.
- Added driver for integrated RTC. (thx GST!)
- Added support for displaying CPU frequencies at boot. (thx GST!)
- Adjust USB timeout to handle dreamplug EHCI chipset.
- Cleaned up MPP registers based on Global Scale code. (thx GST!)
- broke out MACH_TYPE_DREAMPLUG changes since it's going to be a while until the Linux arm tree gets sorted and accepts new boards again. Since all Dreamplugs currently on the market set r1 to MACH_TYPE_GURUPLUG, this allows the board to be added to u-boot while waiting for Linux mainline. Once it's in Linux mainline, then the last patch can be integrated to use MACH_TYPE_DREAMPLUG.

Changes from v5 to v6:

- Define MACH_TYPE_DREAMPLUG in includes/configs/dreamplug.h until Linus's kernel.org tree includes assigned machine id. This is on Wolfgang's recommendation [1].
- Removed dcache disabling as it is no longer enabled by default.
- USB timeout fix was merged.
- Marvell Integrated RTC was merged.
- Dropped CPU frequency printout as I'm not familiar enough with all flavors of kirkwood SoCs to do it correctly.
- Labelled MPP*_GPIO pins that are broken out as gpio pins for the user.
- Fixed function name mv_phy_88e1121_init() -> mv_phy_88e1116_init().

Changes from v6 to v7:

- Use CONFIG_MACH_TYPE in dreamplug.c and define it to MACH_TYPE_DREAMPLUG in include/configs/dreamplug.h

[1] http://www.mail-archive.com/u-boot at lists.denx.de/msg60921.html

 MAINTAINERS                                   |    4 +
 board/Marvell/dreamplug/Makefile              |   54 ++++++++
 board/Marvell/dreamplug/dreamplug.c           |  154 +++++++++++++++++++++++
 board/Marvell/dreamplug/dreamplug.h           |   42 +++++++
 board/Marvell/dreamplug/kwbimage.cfg          |  163 +++++++++++++++++++++++++
 boards.cfg                                    |    1 +
 include/configs/dreamplug.h                   |  159 ++++++++++++++++++++++++
 7 files changed, 577 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/kirkwood/asm-offsets.s
 create mode 100644 board/Marvell/dreamplug/Makefile
 create mode 100644 board/Marvell/dreamplug/dreamplug.c
 create mode 100644 board/Marvell/dreamplug/dreamplug.h
 create mode 100644 board/Marvell/dreamplug/kwbimage.cfg
 create mode 100644 include/configs/dreamplug.h
MAINTAINERS +4 -0
index 2f60a60..88d5637 100644
@@ -70,6 +70,10 @@ Conn Clark <[email protected]>
 
 	ESTEEM192E	MPC8xx
 
+Jason Cooper <[email protected]>
+
+	dreamplug	ARM926EJS (Kirkwood SoC)
+
 Joe D'Abbraccio <[email protected]>
 
 	MPC837xERDB	MPC837x
arch/arm/cpu/arm926ejs/kirkwood/asm-offsets.s new file +0 -0
new file mode 100644
index 0000000..e69de29
board/Marvell/dreamplug/Makefile new file +54 -0

54 lines not on this page · raw message

board/Marvell/dreamplug/dreamplug.c new file +154 -0

154 lines not on this page · raw message

board/Marvell/dreamplug/dreamplug.h new file +42 -0

42 lines not on this page · raw message

board/Marvell/dreamplug/kwbimage.cfg new file +163 -0

163 lines not on this page · raw message

boards.cfg +1 -0
index 8a5bfc1..cceda57 100644
@@ -135,6 +135,7 @@ portl2                       arm         arm926ejs   km_arm              keymile
 inetspace_v2                 arm         arm926ejs   netspace_v2         LaCie          kirkwood    netspace_v2:INETSPACE_V2
 netspace_v2                  arm         arm926ejs   netspace_v2         LaCie          kirkwood    netspace_v2:NETSPACE_V2
 netspace_max_v2              arm         arm926ejs   netspace_v2         LaCie          kirkwood    netspace_v2:NETSPACE_MAX_V2
+dreamplug                    arm         arm926ejs   -                   Marvell        kirkwood
 guruplug                     arm         arm926ejs   -                   Marvell        kirkwood
 mv88f6281gtw_ge              arm         arm926ejs   -                   Marvell        kirkwood
 openrd_base                  arm         arm926ejs   openrd              Marvell        kirkwood        openrd:BOARD_IS_OPENRD_BASE
include/configs/dreamplug.h new file +159 -0

159 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#15 lore raw

PATCH v7 1/1 dreamplug: initial board support.

Quoted 9 lines · Jason Cooper

Copied wholeheartedly from board/Marvell/guruplug and modified to add support for SPI NOR flash.

CONFIG_MACH_DREAMPLUG defined in include/configs/dreamplug.h until Linus's kernel.org tree adds it to mach-types.h. Once it trickles down, the definition can be removed from dreamplug.h.

---

[...]

Quoted 4 lines

Changes from v6 to v7:

- Use CONFIG_MACH_TYPE in dreamplug.c and define it to MACH_TYPE_DREAMPLUG in include/configs/dreamplug.h

Sorry, but you've got me wrong...
All you need to do is define the CONFIG_MACH_TYPE in your config file. The rest will be taken care of by the common code.
See below for details.

[...]

Quoted 5 lines
board/Marvell/dreamplug/dreamplug.c new file +0 -0
new file mode 100644
index 0000000..05098fa

[...]

board/Marvell/dreamplug/dreamplug.c line 108

Quoted 5 lines
board/Marvell/dreamplug/dreamplug.c new file +5 -0
+
+int board_init(void)
+{
+	/* arch number of board */
+	gd->bd->bi_arch_number = CONFIG_MACH_TYPE;

the above two line should be removed.

[...]

Quoted 5 lines
include/configs/dreamplug.h new file +0 -0
new file mode 100644
index 0000000..a7168bd

[...]

Quoted 10 lines
include/configs/dreamplug.h new file +10 -0
+
+/*
+ * FIXME: This belongs in mach-types.h.  However, we only pull mach-types
+ * from Linus' kernel.org tree.  This hasn't been updated primarily due to
+ * the recent arch/arm reshuffling.  So, in the meantime, we'll place it
+ * here.
+ */
+#define MACH_TYPE_DREAMPLUG            3550
+
+#ifdef CONFIG_MACH_DREAMPLUG

include/configs/dreamplug.h line 49

Quoted 10 lines
include/configs/dreamplug.h new file +10 -0
+# ifdef machine_arch_type
+#  undef machine_arch_type
+#  define machine_arch_type	__machine_arch_type
+# else
+#  define machine_arch_type	MACH_TYPE_DREAMPLUG
+# endif
+# define machine_is_dreamplug()	(machine_arch_type == MACH_TYPE_DREAMPLUG)
+#else
+# define machine_is_dreamplug()	(0)
+#endif

Do you actually use the machine_is_dreamplug() macro in your code? If you don't, then you don't need the above block at all.

include/configs/dreamplug.h line 62

Quoted 13 lines
include/configs/dreamplug.h new file +13 -0
+
+/*
+ * Version number information
+ */
+#define CONFIG_IDENT_STRING	"\nMarvell-DreamPlug"
+
+/*
+ * High Level Configuration Options (easy to change)
+ */
+#define CONFIG_SHEEVA_88SV131	1	/* CPU Core subversion */
+#define CONFIG_KIRKWOOD		1	/* SOC Family Name */
+#define CONFIG_KW88F6281	1	/* SOC Name */
+#define CONFIG_MACH_TYPE	MACH_TYPE_DREAMPLUG

The above line is all what you need to setup the machine id (along with MACH_TYPE_DREAMPLUG definition of course, unless it is in mach_type file).

Quoted 1 line

+#define CONFIG_MACH_DREAMPLUG /* Machine type */

shouldn't the above be defined before the machine_is_... block? If you don't need the machine_is_dreamplug() macro, then you also don't need the above line.

[...]

Signature · 2 lines
Regards,
Igor.
author
#16 lore raw

PATCH v7 1/1 dreamplug: initial board support.

Quoted 15 lines · Igor Grinberg
Quoted 9 lines · Jason Cooper

Copied wholeheartedly from board/Marvell/guruplug and modified to add support for SPI NOR flash.

CONFIG_MACH_DREAMPLUG defined in include/configs/dreamplug.h until Linus's kernel.org tree adds it to mach-types.h. Once it trickles down, the definition can be removed from dreamplug.h.

---

[...]

Quoted 2 lines

Changes from v6 to v7:

Quoted 7 lines
Quoted 2 lines

- Use CONFIG_MACH_TYPE in dreamplug.c and define it to MACH_TYPE_DREAMPLUG in include/configs/dreamplug.h

Sorry, but you've got me wrong...
All you need to do is define the CONFIG_MACH_TYPE in your config file. The rest will be taken care of by the common code.
See below for details.

Okay, thanks for the assist, v8 on it's way.

Quoted 83 lines

[...]

Quoted 5 lines
board/Marvell/dreamplug/dreamplug.c new file +0 -0
new file mode 100644
index 0000000..05098fa

[...]

board/Marvell/dreamplug/dreamplug.c line 108

Quoted 5 lines
board/Marvell/dreamplug/dreamplug.c new file +5 -0
+
+int board_init(void)
+{
+	/* arch number of board */
+	gd->bd->bi_arch_number = CONFIG_MACH_TYPE;

the above two line should be removed.

[...]

Quoted 5 lines
include/configs/dreamplug.h new file +0 -0
new file mode 100644
index 0000000..a7168bd

[...]

Quoted 10 lines
include/configs/dreamplug.h new file +10 -0
+
+/*
+ * FIXME: This belongs in mach-types.h.  However, we only pull mach-types
+ * from Linus' kernel.org tree.  This hasn't been updated primarily due to
+ * the recent arch/arm reshuffling.  So, in the meantime, we'll place it
+ * here.
+ */
+#define MACH_TYPE_DREAMPLUG            3550
+
+#ifdef CONFIG_MACH_DREAMPLUG

include/configs/dreamplug.h line 49

Quoted 10 lines
include/configs/dreamplug.h new file +10 -0
+# ifdef machine_arch_type
+#  undef machine_arch_type
+#  define machine_arch_type	__machine_arch_type
+# else
+#  define machine_arch_type	MACH_TYPE_DREAMPLUG
+# endif
+# define machine_is_dreamplug()	(machine_arch_type == MACH_TYPE_DREAMPLUG)
+#else
+# define machine_is_dreamplug()	(0)
+#endif

Do you actually use the machine_is_dreamplug() macro in your code? If you don't, then you don't need the above block at all.

include/configs/dreamplug.h line 62

Quoted 13 lines
include/configs/dreamplug.h new file +13 -0
+
+/*
+ * Version number information
+ */
+#define CONFIG_IDENT_STRING	"\nMarvell-DreamPlug"
+
+/*
+ * High Level Configuration Options (easy to change)
+ */
+#define CONFIG_SHEEVA_88SV131	1	/* CPU Core subversion */
+#define CONFIG_KIRKWOOD		1	/* SOC Family Name */
+#define CONFIG_KW88F6281	1	/* SOC Name */
+#define CONFIG_MACH_TYPE	MACH_TYPE_DREAMPLUG

The above line is all what you need to setup the machine id (along with MACH_TYPE_DREAMPLUG definition of course, unless it is in mach_type file).

Quoted 1 line

+#define CONFIG_MACH_DREAMPLUG /* Machine type */

shouldn't the above be defined before the machine_is_... block? If you don't need the machine_is_dreamplug() macro, then you also don't need the above line.

[...]

Signature · 2 lines
Regards,
Igor.
#17 lore raw

PATCH v7 1/1 dreamplug: initial board support.

In reply to Jason Cooper
Quoted 14 lines

-----Original Message-----
From: Jason Cooper [mailto:u-boot at lakedaemon.net]
Sent: Monday, September 12, 2011 5:15 PM
To: wd at denx.de
Cc: u-boot at lists.denx.de; u-boot at lakedaemon.net; Prafulla Wadaskar; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore
Subject: [PATCH v7] dreamplug: initial board support.

Copied wholeheartedly from board/Marvell/guruplug and modified to add support
for SPI NOR flash.

Quoted 5 lines

CONFIG_MACH_DREAMPLUG defined in include/configs/dreamplug.h until Linus's
kernel.org tree adds it to mach-types.h. Once it trickles down, the definition
can be removed from dreamplug.h.

Hi Jason
This issues it heating up for some other boards too.
Let's have Wolfgang's opinion on this, since this not aligned with current u-boot development strategy.

May be we can create a separate header file for tracking (unsupported/tobe supported) arm machine-types.

Regards..
Prafulla . .

#18 lore raw

PATCH v7 1/1 dreamplug: initial board support.

Dear Prafulla,

Quoted 6 lines · In message <[email protected]>…

Let's have Wolfgang's opinion on this, since this not aligned with current u-boot development strategy.

May be we can create a separate header file for tracking (unsupported/tobe supported) arm machine-types.

Actually this is for Albert to comment. He is the ARM custodian and has to live with the results.

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
Until you walk a mile in another man's moccasins, you  can't  imagine
the smell.
author
#19 lore raw

PATCH v7 1/1 dreamplug: initial board support.

Albert,

Quoted 4 lines · Wolfgang Denk

Dear Prafulla,

Quoted 1 line · In message <[email protected]>…
Quoted 8 lines
Quoted 5 lines

Let's have Wolfgang's opinion on this, since this not aligned with current u-boot development strategy.

May be we can create a separate header file for tracking (unsupported/tobe supported) arm machine-types.

Actually this is for Albert to comment. He is the ARM custodian and has to live with the results.

Wolfgang, Marek Vasut, and I discussed this here [1]. To summarize, by declaring non-mainlined mach_types in the respective board config, an error will be thrown at compile time after mach-types.h is updated to include the mach_type.

The other idea is to have a separate file, say mach-types-local.h where all non-mainlined mach-types would be defined.

Thoughts? I can do whichever.

thx,

Jason.

[1] http://www.mail-archive.com/u-boot at lists.denx.de/msg60921.html

#20 lore raw

PATCH v7 1/1 dreamplug: initial board support.

Quoted 28 lines

-----Original Message-----
From: Jason [mailto:u-boot at lakedaemon.net]
Sent: Tuesday, September 13, 2011 7:47 PM
To: Wolfgang Denk
Cc: Prafulla Wadaskar; Albert Aribaud; u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH v7] dreamplug: initial board support.

Albert,

Quoted 3 lines · Wolfgang Denk

Dear Prafulla,

In message <F766E4F80769BD478052FB6533FA745D1A114670B3@SC-

Quoted 2 lines · VEXCH4.marvell.com> you wrote:
Quoted 2 lines

Let's have Wolfgang's opinion on this, since this not aligned with

current

Quoted 3 lines
Quoted 3 lines

u-boot development strategy.

May be we can create a separate header file for tracking

(unsupported/tobe

Quoted 4 lines
Quoted 1 line

supported) arm machine-types.

Actually this is for Albert to comment. He is the ARM custodian and has to live with the results.

Quoted 7 lines

Wolfgang, Marek Vasut, and I discussed this here [1]. To summarize, by declaring non-mainlined mach_types in the respective board config, an error will be thrown at compile time after mach-types.h is updated to include the mach_type.

The other idea is to have a separate file, say mach-types-local.h where all non-mainlined mach-types would be defined.

I will vote for this second approach so that it becomes independent change and anyone can update it in future.

Let's get Albert's opinion on this.

Regards..
Prafulla . .

Quoted 8 lines

Thoughts? I can do whichever.

thx,

Jason.

[1] http://www.mail-archive.com/u-boot at lists.denx.de/msg60921.html

#21 lore raw

PATCH v7 1/1 dreamplug: initial board support.

(Please do not use my @free.fr address to copy me on U-boot matters...)

Le 14/09/2011 08:39, Prafulla Wadaskar a ?crit :

Quoted 33 lines
Quoted 33 lines

-----Original Message-----
From: Jason [mailto:u-boot at lakedaemon.net]
Sent: Tuesday, September 13, 2011 7:47 PM
To: Wolfgang Denk
Cc: Prafulla Wadaskar; Albert Aribaud; u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH v7] dreamplug: initial board support.

Albert,

Quoted 3 lines · Wolfgang Denk

Dear Prafulla,

In message<F766E4F80769BD478052FB6533FA745D1A114670B3@SC-

Quoted 2 lines · VEXCH4.marvell.com> you wrote:
Quoted 2 lines

Let's have Wolfgang's opinion on this, since this not aligned with

current

Quoted 3 lines
Quoted 3 lines

u-boot development strategy.

May be we can create a separate header file for tracking

(unsupported/tobe

Quoted 4 lines
Quoted 1 line

supported) arm machine-types.

Actually this is for Albert to comment. He is the ARM custodian and has to live with the results.

Wolfgang, Marek Vasut, and I discussed this here [1]. To summarize, by declaring non-mainlined mach_types in the respective board config, an error will be thrown at compile time after mach-types.h is updated to include the mach_type.

Quoted 6 lines
Quoted 2 lines

The other idea is to have a separate file, say mach-types-local.h where all non-mainlined mach-types would be defined.

I will vote for this second approach so that it becomes independent change and anyone can update it in future.

Let's get Albert's opinion on this.

My opinion on the whole mach-type question is "if a board needs a mach-type it's because it will run Linux, so its mach-type should eventually be in the Linux mach-type list". As I understand it, the only case when is not there is because U-Boot support is submitted before Linux mainline support. Thus I second the idea of defining it in the board config header file, possibly even testing for it first and if it already exists, throwing a #error to remind the board maintainer to remove the now useless define from the config file.

Quoted 2 lines

Regards..
Prafulla . .

Amicalement,

Signature · 1 line
Albert.
#22 lore raw

PATCH v7 1/1 dreamplug: initial board support.

Le 18/09/2011 19:58, Albert ARIBAUD a ?crit :

Quoted 2 lines

eventually be in the Linux mach-type list". As I understand it, the only case when is not there is because U-Boot support is submitted before

make that "... when *it* is not there..."

Amicalement,

Signature · 1 line
Albert.
author
#23 lore raw

PATCH v7 1/1 dreamplug: initial board support.

In reply to Albert ARIBAUD

Albert, Prafulla, Wolfgang,

Quoted 24 lines · Albert ARIBAUD

Le 14/09/2011 08:39, Prafulla Wadaskar a ?crit :

Quoted 23 lines
Quoted 12 lines · Wolfgang Denk
Quoted 10 lines
Quoted 6 lines · In message<[email protected]>…

Let's have Wolfgang's opinion on this, since this not aligned with current u-boot development strategy.

May be we can create a separate header file for tracking (unsupported/tobe supported) arm machine-types.

Actually this is for Albert to comment. He is the ARM custodian and has to live with the results.

Quoted 7 lines

Wolfgang, Marek Vasut, and I discussed this here [1]. To summarize, by declaring non-mainlined mach_types in the respective board config, an error will be thrown at compile time after mach-types.h is updated to include the mach_type.

The other idea is to have a separate file, say mach-types-local.h where all non-mainlined mach-types would be defined.

I will vote for this second approach so that it becomes independent change and anyone can update it in future.

Quoted 7 lines
Quoted 1 line

Let's get Albert's opinion on this.

My opinion on the whole mach-type question is "if a board needs a mach-type it's because it will run Linux, so its mach-type should eventually be in the Linux mach-type list". As I understand it, the only case when is not there is because U-Boot support is submitted before Linux mainline support.

Yes, this is true. There is also the corner case where the developer motivated to do the work (me) is still learning devicetree, and Linux won't take new boards for arm unless they are clearly devicetree. :-)

Quoted 4 lines

Thus I second the idea of defining it in the board config header file, possibly even testing for it first and if it already exists, throwing a #error to remind the board maintainer to remove the now useless define from the config file.

Sounds good, I should have a new version up in a few hours.

As for my original question, since this patch series has had several versions on the mailinglist [1] prior to the close of the merge window, is it still possible to get it in for 2011.09?

thx,

Jason.

[1] http://lists.denx.de/pipermail/u-boot/2011-June/094056.html

#24 lore raw

PATCH v7 1/1 dreamplug: initial board support.

Dear Jason,

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

As for my original question, since this patch series has had several versions on the mailinglist [1] prior to the close of the merge window, is it still possible to get it in for 2011.09?

I cannot promise this. We are already pretty much late behind schedule, and close to the (shifted) release date.

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
Either one of us, by himself, is expendable.  Both of us are not.
	-- Kirk, "The Devil in the Dark", stardate 3196.1
author
#25 lore raw

PATCH v7 1/1 dreamplug: initial board support.

Wolfgang,

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

As for my original question, since this patch series has had several versions on the mailinglist [1] prior to the close of the merge window, is it still possible to get it in for 2011.09?

I cannot promise this. We are already pretty much late behind schedule, and close to the (shifted) release date.

Ok, I hope it makes it in. If not, I understand. We didn't get the mach-types workaround hammered out until late.

thx,

Jason.

#26 lore raw

PATCH v8 1/1 dreamplug: initial board support.

In reply to Jason Cooper

Copied wholeheartedly from board/Marvell/guruplug and modified to add support for SPI NOR flash.

CONFIG_MACH_DREAMPLUG defined in include/configs/dreamplug.h until Linus's kernel.org tree adds it to mach-types.h. Once it trickles down, the definition can be removed from include/configs/dreamplug.h.

---
Changes from v1 to v2:

- resorted series to move 'make all' support last.

Changes from v2 to v3:

- Use MACH_TYPE_GURUPLUG for now until dreamplug support is in Linux.
- Update MAINTAINERS.
- Collapse into one patch.

Changes from v3 to v4:

- update copyright info as recommended by Prafulla Wadaskar.
- maintain proper order in boards.cfg, MAINTAINERS, etc.
- label MPP's
- change back to MACH_TYPE_DREAMPLUG. This patch is just RFC until the Dreamplug is supported in Linux (and MACH_TYPE_ added).

Changes from v4 to v5:

- Complete rewrite due to receiving u-boot source indirectly from Global Scale Tech.
- Added driver for integrated RTC. (thx GST!)
- Added support for displaying CPU frequencies at boot. (thx GST!)
- Adjust USB timeout to handle dreamplug EHCI chipset.
- Cleaned up MPP registers based on Global Scale code. (thx GST!)
- broke out MACH_TYPE_DREAMPLUG changes since it's going to be a while until the Linux arm tree gets sorted and accepts new boards again. Since all Dreamplugs currently on the market set r1 to MACH_TYPE_GURUPLUG, this allows the board to be added to u-boot while waiting for Linux mainline. Once it's in Linux mainline, then the last patch can be integrated to use MACH_TYPE_DREAMPLUG.

Changes from v5 to v6:

- Define MACH_TYPE_DREAMPLUG in includes/configs/dreamplug.h until Linus's kernel.org tree includes assigned machine id. This is on Wolfgang's recommendation [1].
- Removed dcache disabling as it is no longer enabled by default.
- USB timeout fix was merged.
- Marvell Integrated RTC was merged.
- Dropped CPU frequency printout as I'm not familiar enough with all flavors of kirkwood SoCs to do it correctly.
- Labelled MPP*_GPIO pins that are broken out as gpio pins for the user.
- Fixed function name mv_phy_88e1121_init() -> mv_phy_88e1116_init().

Changes from v6 to v7:

- Use CONFIG_MACH_TYPE in dreamplug.c and define it to MACH_TYPE_DREAMPLUG in include/configs/dreamplug.h

Changes from v7 to v8:

- #error MACH_TYPE_DREAMPLUG once it is defined in mach-types.h. On Albert Aribaud's recommendation.

[1] http://www.mail-archive.com/u-boot at lists.denx.de/msg60921.html

 MAINTAINERS                                   |    4 +
 board/Marvell/dreamplug/Makefile              |   54 ++++++++
 board/Marvell/dreamplug/dreamplug.c           |  151 +++++++++++++++++++++++
 board/Marvell/dreamplug/dreamplug.h           |   42 +++++++
 board/Marvell/dreamplug/kwbimage.cfg          |  163 +++++++++++++++++++++++++
 boards.cfg                                    |    1 +
 include/configs/dreamplug.h                   |  151 +++++++++++++++++++++++
 7 files changed, 566 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/kirkwood/asm-offsets.s
 create mode 100644 board/Marvell/dreamplug/Makefile
 create mode 100644 board/Marvell/dreamplug/dreamplug.c
 create mode 100644 board/Marvell/dreamplug/dreamplug.h
 create mode 100644 board/Marvell/dreamplug/kwbimage.cfg
 create mode 100644 include/configs/dreamplug.h
MAINTAINERS +4 -0
index 2f60a60..88d5637 100644
@@ -70,6 +70,10 @@ Conn Clark <[email protected]>
 
 	ESTEEM192E	MPC8xx
 
+Jason Cooper <[email protected]>
+
+	dreamplug	ARM926EJS (Kirkwood SoC)
+
 Joe D'Abbraccio <[email protected]>
 
 	MPC837xERDB	MPC837x
arch/arm/cpu/arm926ejs/kirkwood/asm-offsets.s new file +0 -0
new file mode 100644
index 0000000..e69de29
board/Marvell/dreamplug/Makefile new file +54 -0

54 lines not on this page · raw message

board/Marvell/dreamplug/dreamplug.c new file +151 -0

151 lines not on this page · raw message

board/Marvell/dreamplug/dreamplug.h new file +42 -0

42 lines not on this page · raw message

board/Marvell/dreamplug/kwbimage.cfg new file +163 -0

163 lines not on this page · raw message

boards.cfg +1 -0
index 8a5bfc1..cceda57 100644
@@ -135,6 +135,7 @@ portl2                       arm         arm926ejs   km_arm              keymile
 inetspace_v2                 arm         arm926ejs   netspace_v2         LaCie          kirkwood    netspace_v2:INETSPACE_V2
 netspace_v2                  arm         arm926ejs   netspace_v2         LaCie          kirkwood    netspace_v2:NETSPACE_V2
 netspace_max_v2              arm         arm926ejs   netspace_v2         LaCie          kirkwood    netspace_v2:NETSPACE_MAX_V2
+dreamplug                    arm         arm926ejs   -                   Marvell        kirkwood
 guruplug                     arm         arm926ejs   -                   Marvell        kirkwood
 mv88f6281gtw_ge              arm         arm926ejs   -                   Marvell        kirkwood
 openrd_base                  arm         arm926ejs   openrd              Marvell        kirkwood        openrd:BOARD_IS_OPENRD_BASE
include/configs/dreamplug.h new file +151 -0

151 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#27 lore raw

PATCH v8 1/1 dreamplug: initial board support.

Quoted 97 lines

-----Original Message-----
From: Jason Cooper [mailto:u-boot at lakedaemon.net]
Sent: Monday, September 19, 2011 12:37 AM
To: wd at denx.de
Cc: u-boot at lists.denx.de; albert.u.boot at aribaud.net; Prafulla Wadaskar; u-boot at lakedaemon.net
Subject: [PATCH v8] dreamplug: initial board support.

Copied wholeheartedly from board/Marvell/guruplug and modified to add support
for SPI NOR flash.

CONFIG_MACH_DREAMPLUG defined in include/configs/dreamplug.h until Linus's
kernel.org tree adds it to mach-types.h. Once it trickles down, the definition
can be removed from include/configs/dreamplug.h.

---
Changes from v1 to v2:

- resorted series to move 'make all' support last.

Changes from v2 to v3:

- Use MACH_TYPE_GURUPLUG for now until dreamplug support is in Linux.
- Update MAINTAINERS.
- Collapse into one patch.

Changes from v3 to v4:

- update copyright info as recommended by Prafulla Wadaskar.
- maintain proper order in boards.cfg, MAINTAINERS, etc.
- label MPP's
- change back to MACH_TYPE_DREAMPLUG. This patch is just RFC until the Dreamplug is supported in Linux (and MACH_TYPE_ added).

Changes from v4 to v5:

- Complete rewrite due to receiving u-boot source indirectly from Global Scale Tech.
- Added driver for integrated RTC. (thx GST!)
- Added support for displaying CPU frequencies at boot. (thx GST!)
- Adjust USB timeout to handle dreamplug EHCI chipset.
- Cleaned up MPP registers based on Global Scale code. (thx GST!)
- broke out MACH_TYPE_DREAMPLUG changes since it's going to be a while until the Linux arm tree gets sorted and accepts new boards again. Since all Dreamplugs currently on the market set r1 to MACH_TYPE_GURUPLUG, this allows the board to be added to u-boot while waiting for Linux mainline. Once it's in Linux mainline, then the last patch can be integrated to
use
MACH_TYPE_DREAMPLUG.

Changes from v5 to v6:

- Define MACH_TYPE_DREAMPLUG in includes/configs/dreamplug.h until Linus's kernel.org tree includes assigned machine id. This is on Wolfgang's recommendation [1].
- Removed dcache disabling as it is no longer enabled by default.
- USB timeout fix was merged.
- Marvell Integrated RTC was merged.
- Dropped CPU frequency printout as I'm not familiar enough with all flavors of kirkwood SoCs to do it correctly.
- Labelled MPP*_GPIO pins that are broken out as gpio pins for the user.
- Fixed function name mv_phy_88e1121_init() ->
mv_phy_88e1116_init().

Changes from v6 to v7:

- Use CONFIG_MACH_TYPE in dreamplug.c and define it to MACH_TYPE_DREAMPLUG in include/configs/dreamplug.h

Changes from v7 to v8:

- #error MACH_TYPE_DREAMPLUG once it is defined in mach-types.h. On Albert Aribaud's recommendation.

[1] http://www.mail-archive.com/u-boot at lists.denx.de/msg60921.html

 MAINTAINERS                                   |    4 +
 board/Marvell/dreamplug/Makefile              |   54 ++++++++
 board/Marvell/dreamplug/dreamplug.c           |  151
+++++++++++++++++++++++
 board/Marvell/dreamplug/dreamplug.h           |   42 +++++++
 board/Marvell/dreamplug/kwbimage.cfg          |  163
+++++++++++++++++++++++++
 boards.cfg                                    |    1 +
 include/configs/dreamplug.h                   |  151
Quoted 9 lines

+++++++++++++++++++++++

 7 files changed, 566 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/kirkwood/asm-offsets.s
 create mode 100644 board/Marvell/dreamplug/Makefile
 create mode 100644 board/Marvell/dreamplug/dreamplug.c
 create mode 100644 board/Marvell/dreamplug/dreamplug.h
 create mode 100644 board/Marvell/dreamplug/kwbimage.cfg
 create mode 100644 include/configs/dreamplug.h

Applied to u-boot-marvell.git master branch

Regards..
Prafulla . .

#28 lore raw

[U-Boot] RFC [PATCH 1/5] drivers/rtc: add Marvell Integrated RTC.

In reply to u-boot at lakedaemon.net
---
 drivers/rtc/Makefile      |    1 +
 drivers/rtc/mvinteg_rtc.c |  151 +++++++++++++++++++++++++++++++++++++++++++++
 drivers/rtc/mvinteg_rtc.h |   89 ++++++++++++++++++++++++++
 3 files changed, 241 insertions(+), 0 deletions(-)
 create mode 100644 drivers/rtc/mvinteg_rtc.c
 create mode 100644 drivers/rtc/mvinteg_rtc.h
drivers/rtc/Makefile +1 -0
index e4be4a4..ed63e9c 100644
@@ -55,6 +55,7 @@ COBJS-$(CONFIG_MCFRTC) += mcfrtc.o
 COBJS-$(CONFIG_RTC_MK48T59) += mk48t59.o
 COBJS-$(CONFIG_RTC_MPC5200) += mpc5xxx.o
 COBJS-$(CONFIG_RTC_MPC8xx) += mpc8xx.o
+COBJS-$(CONFIG_RTC_MVINTEG) += mvinteg_rtc.o
 COBJS-$(CONFIG_RTC_PCF8563) += pcf8563.o
 COBJS-$(CONFIG_RTC_PL031) += pl031.o
 COBJS-$(CONFIG_RTC_PT7C4338) += pt7c4338.o
drivers/rtc/mvinteg_rtc.c new file +151 -0

151 lines not on this page · raw message

drivers/rtc/mvinteg_rtc.h new file +89 -0

89 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#29 lore raw

[U-Boot] RFC [PATCH 1/5] drivers/rtc: add Marvell Integrated RTC.

Quoted 11 lines

-----Original Message-----
From: Jason Cooper [mailto:u-boot at lakedaemon.net]
Sent: Wednesday, July 27, 2011 2:49 AM
To: clint at debian.org; wd at denx.de; Prafulla Wadaskar
Cc: u-boot at lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale at gag.com; Jason Cooper
Subject: RFC [PATCH 1/5] drivers/rtc: add Marvell Integrated RTC.

Quoted 4 lines
---
 drivers/rtc/Makefile      |    1 +
 drivers/rtc/mvinteg_rtc.c |  151

Filename mvrtc.c sounds more relevent

Quoted 204 lines

+++++++++++++++++++++++++++++++++++++++++++++

 drivers/rtc/mvinteg_rtc.h |   89 ++++++++++++++++++++++++++
 3 files changed, 241 insertions(+), 0 deletions(-)
 create mode 100644 drivers/rtc/mvinteg_rtc.c
 create mode 100644 drivers/rtc/mvinteg_rtc.h
drivers/rtc/Makefile +1 -0
index e4be4a4..ed63e9c 100644
@@ -55,6 +55,7 @@ COBJS-$(CONFIG_MCFRTC) += mcfrtc.o
 COBJS-$(CONFIG_RTC_MK48T59) += mk48t59.o
 COBJS-$(CONFIG_RTC_MPC5200) += mpc5xxx.o
 COBJS-$(CONFIG_RTC_MPC8xx) += mpc8xx.o
+COBJS-$(CONFIG_RTC_MVINTEG) += mvinteg_rtc.o
 COBJS-$(CONFIG_RTC_PCF8563) += pcf8563.o
 COBJS-$(CONFIG_RTC_PL031) += pl031.o
 COBJS-$(CONFIG_RTC_PT7C4338) += pt7c4338.o
drivers/rtc/mvinteg_rtc.c new file +151 -0
new file mode 100644
index 0000000..295e4f7
@@ -0,0 +1,151 @@
+/*
+ * Copyright (C) 2011
+ * Jason Cooper <[email protected]>
+ *
+ * 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
+ */
+
+/*
+ * Date & Time support for Marvell Integrated RTC
+ */
+
+#include <common.h>
+#include <command.h>
+#include <rtc.h>
+#include "mvinteg_rtc.h"
+
+/* This RTC does not support century, so we assume 20 */
+#define CENTURY 20
+
+int rtc_get(struct rtc_time *t)
+{
+	u32 time;
+	u32 date;
+	u8  tens;
+	u8  single;
+
+	/* read the time register */
+	time = MV_REG_READ(MVINTEG_RTCTIME_REG);
+
+	/* read the date register */
+	date = MV_REG_READ(MVINTEG_RTCDATE_REG);
+
+	/* seconds */
+	tens   = ((time & MVINTEG_10SEC_MSK) >> MVINTEG_10SEC_SFT);
+	single = ((time & MVINTEG_SEC_MSK)   >> MVINTEG_SEC_SFT);
+	t->tm_sec = 10 * tens + single;
+
+	/* minutes */
+	tens   = ((time & MVINTEG_10MIN_MSK) >> MVINTEG_10MIN_SFT);
+	single = ((time & MVINTEG_MIN_MSK)   >> MVINTEG_MIN_SFT);
+	t->tm_min = 10 * tens + single;
+
+	/* hours */
+	tens   = ((time & MVINTEG_10HOUR_MSK) >> MVINTEG_10HOUR_SFT);
+	single = ((time & MVINTEG_HOUR_MSK)   >> MVINTEG_HOUR_SFT);
+	t->tm_hour = 10 * tens + single;
+
+	/* day */
+	t->tm_wday = ((time & MVINTEG_DAY_MSK) >> MVINTEG_DAY_SFT);
+	t->tm_wday--;
+
+	/* date */
+	tens   = ((date & MVINTEG_10DATE_MSK) >> MVINTEG_10DATE_SFT);
+	single = ((date & MVINTEG_DATE_MSK)   >> MVINTEG_DATE_SFT);
+	t->tm_mday = 10 * tens + single;
+
+	/* month */
+	tens   = ((date & MVINTEG_10MON_MSK) >> MVINTEG_10MON_SFT);
+	single = ((date & MVINTEG_MON_MSK)   >> MVINTEG_MON_SFT);
+	t->tm_mon = 10 * tens + single;
+
+	/* year */
+	tens   = ((date & MVINTEG_10YEAR_MSK) >> MVINTEG_10YEAR_SFT);
+	single = ((date & MVINTEG_YEAR_MSK)   >> MVINTEG_YEAR_SFT);
+	t->tm_year = (CENTURY * 100) + (10 * tens) + single;
+
+	/* not supported in this RTC */
+	t->tm_yday  = 0;
+	t->tm_isdst = 0;
+
+	return 0;
+}
+
+int rtc_set(struct rtc_time *t)
+{
+	u32 time = 0;
+	u32 date = 0;
+	u32 tens;
+	u32 single;
+
+	/* seconds */
+	tens   = t->tm_sec / 10;
+	single = t->tm_sec % 10;
+	time |= ((tens   << MVINTEG_10SEC_SFT) & MVINTEG_10SEC_MSK) |
+		((single << MVINTEG_SEC_SFT)   & MVINTEG_SEC_MSK);
+
+	/* minutes */
+	tens   = t->tm_min / 10;
+	single = t->tm_min % 10;
+	time |= ((tens   << MVINTEG_10MIN_SFT) & MVINTEG_10MIN_MSK) |
+		((single << MVINTEG_MIN_SFT)   & MVINTEG_MIN_MSK);
+
+	/* hours (24) */
+	tens   = t->tm_hour / 10;
+	single = t->tm_hour % 10;
+	time |= ((tens   << MVINTEG_10HOUR_SFT) & MVINTEG_10HOUR_MSK) |
+		((single << MVINTEG_HOUR_SFT)   & MVINTEG_HOUR_MSK);
+
+	/* day */
+	single = t->tm_wday + 1;
+	time |= ((single << MVINTEG_DAY_SFT) & MVINTEG_DAY_MSK);
+
+	/* date */
+	tens   = t->tm_mday / 10;
+	single = t->tm_mday % 10;
+	date |= ((tens   << MVINTEG_10DATE_SFT) & MVINTEG_10DATE_MSK) |
+		((single << MVINTEG_DATE_SFT)   & MVINTEG_DATE_MSK);
+
+	/* month */
+	tens   = t->tm_mon / 10;
+	single = t->tm_mon % 10;
+	date |= ((tens   << MVINTEG_10MON_SFT) & MVINTEG_10MON_MSK) |
+		((single << MVINTEG_MON_SFT)   & MVINTEG_MON_MSK);
+
+	/* year */
+	if ((t->tm_year / 100) != CENTURY)
+		printf("Warning: Only century %d supported.\n", CENTURY);
+	tens   = (t->tm_year % 100) / 10;
+	single = (t->tm_year % 100) % 10;
+	date |= ((tens   << MVINTEG_10YEAR_SFT) & MVINTEG_10YEAR_MSK) |
+		((single << MVINTEG_YEAR_SFT)   & MVINTEG_YEAR_MSK);
+
+	/* write the time register */
+	MV_REG_WRITE(MVINTEG_RTCTIME_REG, time);
+
+	/* write the date register */
+	MV_REG_WRITE(MVINTEG_RTCDATE_REG, date);
+
+	return 0;
+}
+
+void rtc_reset(void)
+{
+	/* no init routine for this RTC needed */
+}
drivers/rtc/mvinteg_rtc.h new file +23 -0
new file mode 100644
index 0000000..522c5d0
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2011
+ * Jason Cooper <[email protected]>
+ *
+ * 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
+ */
+

drivers/rtc/mvinteg_rtc.h line 33

Quoted 10 lines
drivers/rtc/mvinteg_rtc.h new file +10 -0
+/*
+ * Date & Time support for Marvell Integrated RTC
+ */
+
+#ifndef _MVINTEG_RTC_H_
+#define _MVINTEG_RTC_H_
+
+#include <compiler.h>
+
+#define INTERNAL_REG_BASE_ADDR 0xf1000000

This must go in kirkood.h

Quoted 5 lines
drivers/rtc/mvinteg_rtc.h new file +5 -0
+
+/* register operations macros */
+#define MV_REG_READ(offset) \
+	le32_to_cpu( \
+	*(volatile unsigned int *)(INTERNAL_REG_BASE_ADDR + offset))

drivers/rtc/mvinteg_rtc.h line 48

Quoted 10 lines
drivers/rtc/mvinteg_rtc.h new file +10 -0
+
+#define MV_REG_WRITE(offset, data) \
+	do { \
+		*(volatile unsigned int *)(INTERNAL_REG_BASE_ADDR + offset) = \
+		cpu_to_le32(data); \
+	} while (0);
+
+/* RTC registers */
+#define MVINTEG_RTCTIME_REG 0x10300
+#define MVINTEG_RTCDATE_REG 0x10304

NAK, please use c-strut for register definations

Quoted 32 lines
drivers/rtc/mvinteg_rtc.h new file +32 -0
+
+/* time register */
+#define MVINTEG_SEC_SFT		0
+#define MVINTEG_SEC_MSK		(0xf << MVINTEG_SEC_SFT)
+#define MVINTEG_10SEC_SFT	4
+#define MVINTEG_10SEC_MSK	(0x7 << MVINTEG_10SEC_SFT)
+
+#define MVINTEG_MIN_SFT		8
+#define MVINTEG_MIN_MSK		(0xf << MVINTEG_MIN_SFT)
+#define MVINTEG_10MIN_SFT	12
+#define MVINTEG_10MIN_MSK	(0x7 << MVINTEG_10MIN_SFT)
+
+#define MVINTEG_HOUR_SFT	16
+#define MVINTEG_HOUR_MSK	(0xf << MVINTEG_HOUR_SFT)
+#define MVINTEG_10HOUR_SFT	20
+#define MVINTEG_10HOUR_MSK	(0x3 << MVINTEG_10HOUR_SFT)
+
+#define MVINTEG_HRFMT_SFT	22
+#define MVINTEG_HRFMT12_MSK	(0x1 << MVINTEG_HRFMT_SFT)
+#define MVINTEG_HRFMT24_MSK	(0x0 << MVINTEG_HRFMT_SFT)
+
+#define MVINTEG_DAY_SFT		24
+#define MVINTEG_DAY_MSK		(0x7 << MVINTEG_DAY_SFT)
+
+/* date register */
+#define MVINTEG_DATE_SFT	0
+#define MVINTEG_DATE_MSK	(0xf << MVINTEG_DATE_SFT)
+#define MVINTEG_10DATE_SFT	4
+#define MVINTEG_10DATE_MSK	(0x3 << MVINTEG_10DATE_SFT)
+
+#define MVINTEG_MON_SFT		8
+#define MVINTEG_MON_MSK		(0xf << MVINTEG_MON_SFT)

drivers/rtc/mvinteg_rtc.h

Quoted 10 lines
drivers/rtc/mvinteg_rtc.h new file +9 -1
+#define MVINTEG_10MON_SFT	12
+#define MVINTEG_10MON_MSK	(0x1 << MVINTEG_10MON_SFT)
+
+#define MVINTEG_YEAR_SFT	16
+#define MVINTEG_YEAR_MSK	(0xf << MVINTEG_YEAR_SFT)
+#define MVINTEG_10YEAR_SFT	20
+#define MVINTEG_10YEAR_MSK	(0xf << MVINTEG_10YEAR_SFT)
+
+#endif
--

Regards..
Prafulla . .

Quoted 1 line

1.7.0.4

#30 lore raw

[U-Boot] RFC [PATCH 1/5] drivers/rtc: add Marvell Integrated RTC.

Quoted 11 lines · Prafulla Wadaskar
Quoted 11 lines

-----Original Message-----
From: Jason Cooper [mailto:u-boot at lakedaemon.net]
Sent: Wednesday, July 27, 2011 2:49 AM
To: clint at debian.org; wd at denx.de; Prafulla Wadaskar
Cc: u-boot at lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale at gag.com; Jason Cooper
Subject: RFC [PATCH 1/5] drivers/rtc: add Marvell Integrated RTC.

Quoted 6 lines
Quoted 4 lines
---
 drivers/rtc/Makefile      |    1 +
 drivers/rtc/mvinteg_rtc.c |  151

Filename mvrtc.c sounds more relevent

Will do.

...

Quoted 3 lines
Quoted 1 line

+#define INTERNAL_REG_BASE_ADDR 0xf1000000

This must go in kirkood.h

Thanks. That didn't feel right to me, but I didn't know the proper place to put it.

...

Quoted 9 lines
Quoted 9 lines
drivers/rtc/mvinteg_rtc.h new file +9 -0
+
+/* register operations macros */
+#define MV_REG_READ(offset) \
+	le32_to_cpu( \
+	*(volatile unsigned int *)(INTERNAL_REG_BASE_ADDR + offset))
+
+#define MV_REG_WRITE(offset, data) \
+	do { \
+		*(volatile unsigned int *)(INTERNAL_REG_BASE_ADDR + offset) = \
Quoted 8 lines

drivers/rtc/mvinteg_rtc.h line 48

Quoted 6 lines
drivers/rtc/mvinteg_rtc.h new file +6 -0
+		cpu_to_le32(data); \
+	} while (0);
+
+/* RTC registers */
+#define MVINTEG_RTCTIME_REG 0x10300
+#define MVINTEG_RTCDATE_REG 0x10304

NAK, please use c-strut for register definations

So then, in kirkwood.h:

#define KW_RTC_BASE (KW_REGISTER(0x10300))

and then use accordingly:

struct mvrtc_registers {
	u32 time;
	u32 date;
};

struct mvrtc_registers *mvrtc_regs = (struct mvrtc_registers *)KW_RTC_BASE;

Right? I'm basing this on kirkwood/timer.c

...

Quoted 2 lines

Regards..
Prafulla . .

As always, thanks for the review and comments.

thx,

Jason.

#31 lore raw

[U-Boot] RFC [PATCH 1/5] drivers/rtc: add Marvell Integrated RTC.

Quoted 71 lines

-----Original Message-----
From: Jason [mailto:twuug at lakedaemon.net]
Sent: Thursday, July 28, 2011 6:52 AM
To: Prafulla Wadaskar
Cc: clint at debian.org; wd at denx.de; u-boot at lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale at gag.com
Subject: Re: RFC [PATCH 1/5] drivers/rtc: add Marvell Integrated RTC.

Quoted 7 lines · Prafulla Wadaskar
Quoted 7 lines

-----Original Message-----
From: Jason Cooper [mailto:u-boot at lakedaemon.net]
Sent: Wednesday, July 27, 2011 2:49 AM
To: clint at debian.org; wd at denx.de; Prafulla Wadaskar
Cc: u-boot at lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare;

Siddarth

Quoted 10 lines
Quoted 8 lines

Gore; bdale at gag.com; Jason Cooper
Subject: RFC [PATCH 1/5] drivers/rtc: add Marvell Integrated RTC.

---
 drivers/rtc/Makefile      |    1 +
 drivers/rtc/mvinteg_rtc.c |  151

Filename mvrtc.c sounds more relevent

Will do.

...

Quoted 3 lines
Quoted 1 line

+#define INTERNAL_REG_BASE_ADDR 0xf1000000

This must go in kirkood.h

Thanks. That didn't feel right to me, but I didn't know the proper place to put it.

...

Quoted 9 lines

drivers/rtc/mvinteg_rtc.h

Quoted 9 lines
drivers/rtc/mvinteg_rtc.h new file +9 -0
+
+/* register operations macros */
+#define MV_REG_READ(offset) \
+	le32_to_cpu( \
+	*(volatile unsigned int *)(INTERNAL_REG_BASE_ADDR + offset))
+
+#define MV_REG_WRITE(offset, data) \
+	do { \
+		*(volatile unsigned int *)(INTERNAL_REG_BASE_ADDR + offset)

= \

Quoted 8 lines

drivers/rtc/mvinteg_rtc.h line 48

Quoted 6 lines
drivers/rtc/mvinteg_rtc.h new file +6 -0
+		cpu_to_le32(data); \
+	} while (0);
+
+/* RTC registers */
+#define MVINTEG_RTCTIME_REG 0x10300
+#define MVINTEG_RTCDATE_REG 0x10304

NAK, please use c-strut for register definations

So then, in kirkwood.h:

#define KW_RTC_BASE (KW_REGISTER(0x10300))

and then use accordingly:

struct mvrtc_registers {
	u32 time;
	u32 date;
};
Quoted 4 lines

struct mvrtc_registers *mvrtc_regs = (struct mvrtc_registers *)KW_RTC_BASE;

Right? I'm basing this on kirkwood/timer.c

That's perfect :-)

Quoted 6 lines

...

Quoted 2 lines

Regards..
Prafulla . .

As always, thanks for the review and comments.

That's my pleasure too.

Regards..
Prafulla . .

#32 lore raw

[U-Boot] RFC [PATCH 2/5] arm/kirkwood: print speeds with cpu info.

In reply to u-boot at lakedaemon.net
---
 arch/arm/cpu/arm926ejs/kirkwood/cpu.c    |   46 ++++++++++++++++++++++++++++++
 arch/arm/include/asm/arch-kirkwood/cpu.h |    1 +
 2 files changed, 47 insertions(+), 0 deletions(-)
arch/arm/cpu/arm926ejs/kirkwood/cpu.c +46 -0
index b4a4c04..a69f9f2 100644
@@ -270,11 +270,26 @@ static void kw_sysrst_check(void)
 }
 
 #if defined(CONFIG_DISPLAY_CPUINFO)
+#define MSAR_CPUCLCK_EXTRACT(X)	(((X & 0x2) >> 1) | ((X & 0x400000) >> 21) | \
+				((X & 0x18) >> 1))
+#define MSAR_L2CLCK_EXTRACT(X)  (((X & 0x600) >> 9) | ((X & 0x80000) >> 17))
+#define MSAR_DDRCLCK_RTIO_MASK  (0xf << 5)
+
+#define MSAR_TCLCK_OFFS		21
+#define MSAR_TCLCK_MASK		(0x1 << MSAR_TCLCK_OFFS)
+#define MV_BOARD_TCLK_166MHZ	166666667
+#define MV_BOARD_TCLK_200MHZ	200000000
+#define MSAR_TCLCK_167		(0x1 << MSAR_TCLCK_OFFS)
+#define MSAR_TCLCK_200		(0x0 << MSAR_TCLCK_OFFS)
+
 int print_cpuinfo(void)
 {
 	char *rev;
 	u16 devid = (readl(KW_REG_PCIE_DEVID) >> 16) & 0xffff;
 	u8 revid = readl(KW_REG_PCIE_REVID) & 0xff;
+	u32 cpu_clk, t_clk, tmp;
+	u32 sys_clk, l2_clk;
+	u32 l2_ratio, ddr_ratio;
 
 	if ((readl(KW_REG_DEVICE_ID) & 0x03) > 2) {
 		printf("Error.. %s:Unsupported Kirkwood SoC 88F%04x\n", __FUNCTION__, devid);
@@ -297,6 +312,37 @@ int print_cpuinfo(void)
 	}
 
 	printf("SoC:   Kirkwood 88F%04x_%s\n", devid, rev);
+
+	tmp = readl(MPP_SAMPLE_AT_RESET);
+	cpu_clk = MSAR_CPUCLCK_EXTRACT(tmp);
+	if (cpu_clk == 0x9)
+		cpu_clk = 1200;
+
+	l2_ratio = MSAR_L2CLCK_EXTRACT(tmp);
+	l2_clk = cpu_clk / l2_ratio;
+
+	ddr_ratio = tmp & MSAR_DDRCLCK_RTIO_MASK;
+	ddr_ratio = ddr_ratio >> 5;
+	if (ddr_ratio == 4)
+		sys_clk = 400;
+
+	switch (tmp & MSAR_TCLCK_MASK) {
+	case MSAR_TCLCK_167:
+		t_clk = MV_BOARD_TCLK_166MHZ;
+		break;
+	case MSAR_TCLCK_200:
+		t_clk = MV_BOARD_TCLK_200MHZ;
+		break;
+	default:
+		t_clk = MV_BOARD_TCLK_200MHZ;
+		break;
+	}
+
+	printf("CPU running @ %dMHz L2 running @ %dMHz\n",
+		cpu_clk, l2_clk);
+	printf("SysClock = %dMHz, TClock = %dMHz\n",
+		sys_clk, t_clk / 1000000);
+
 	return 0;
 }
 #endif /* CONFIG_DISPLAY_CPUINFO */
arch/arm/include/asm/arch-kirkwood/cpu.h +1 -0
index d28c51a..28ddd25 100644
@@ -41,6 +41,7 @@
 #define KW_REG_SYSRST_CNT		(KW_MPP_BASE + 0x50)
 #define SYSRST_CNT_1SEC_VAL		(25*1000000)
 #define KW_REG_MPP_OUT_DRV_REG		(KW_MPP_BASE + 0xE0)
+#define MPP_SAMPLE_AT_RESET		(KW_MPP_BASE + 0x30)
 
 enum memory_bank {
 	BANK0,
Signature · 1 line
1.7.0.4
#33 lore raw

[U-Boot] RFC [PATCH 2/5] arm/kirkwood: print speeds with cpu info.

Quoted 30 lines

-----Original Message-----
From: Jason Cooper [mailto:u-boot at lakedaemon.net]
Sent: Wednesday, July 27, 2011 2:49 AM
To: clint at debian.org; wd at denx.de; Prafulla Wadaskar
Cc: u-boot at lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale at gag.com; Jason Cooper
Subject: RFC [PATCH 2/5] arm/kirkwood: print speeds with cpu info.

---
 arch/arm/cpu/arm926ejs/kirkwood/cpu.c    |   46
++++++++++++++++++++++++++++++
 arch/arm/include/asm/arch-kirkwood/cpu.h |    1 +
 2 files changed, 47 insertions(+), 0 deletions(-)
arch/arm/cpu/arm926ejs/kirkwood/cpu.c +2 -0
index b4a4c04..a69f9f2 100644
@@ -270,11 +270,26 @@ static void kw_sysrst_check(void)
 }
 
 #if defined(CONFIG_DISPLAY_CPUINFO)
+#define MSAR_CPUCLCK_EXTRACT(X)	(((X & 0x2) >> 1) | ((X & 0x400000) >>
 21) | \
+				((X & 0x18) >> 1))

arch/arm/cpu/arm926ejs/kirkwood/cpu.c static void kw_sysrst_check(void) · line 285

Quoted 10 lines
arch/arm/cpu/arm926ejs/kirkwood/cpu.c +9 -0
+#define MSAR_L2CLCK_EXTRACT(X)  (((X & 0x600) >> 9) | ((X & 0x80000) >>
 17))
+#define MSAR_DDRCLCK_RTIO_MASK  (0xf << 5)
+
+#define MSAR_TCLCK_OFFS		21
+#define MSAR_TCLCK_MASK		(0x1 << MSAR_TCLCK_OFFS)
+#define MV_BOARD_TCLK_166MHZ	166666667
+#define MV_BOARD_TCLK_200MHZ	200000000
+#define MSAR_TCLCK_167		(0x1 << MSAR_TCLCK_OFFS)
+#define MSAR_TCLCK_200		(0x0 << MSAR_TCLCK_OFFS)

There are one time used macros, can they be optimized?

Quoted 37 lines
arch/arm/cpu/arm926ejs/kirkwood/cpu.c +4 -0
+
 int print_cpuinfo(void)
 {
 	char *rev;
 	u16 devid = (readl(KW_REG_PCIE_DEVID) >> 16) & 0xffff;
 	u8 revid = readl(KW_REG_PCIE_REVID) & 0xff;
+	u32 cpu_clk, t_clk, tmp;
+	u32 sys_clk, l2_clk;
+	u32 l2_ratio, ddr_ratio;
 
arch/arm/cpu/arm926ejs/kirkwood/cpu.c +0 -0
 	if ((readl(KW_REG_DEVICE_ID) & 0x03) > 2) {
 		printf("Error.. %s:Unsupported Kirkwood SoC 88F%04x\n",

__FUNCTION__, devid);

arch/arm/cpu/arm926ejs/kirkwood/cpu.c +20 -0
@@ -297,6 +312,37 @@ int print_cpuinfo(void)
 	}
 
 	printf("SoC:   Kirkwood 88F%04x_%s\n", devid, rev);
+
+	tmp = readl(MPP_SAMPLE_AT_RESET);
+	cpu_clk = MSAR_CPUCLCK_EXTRACT(tmp);
+	if (cpu_clk == 0x9)
+		cpu_clk = 1200;
+
+	l2_ratio = MSAR_L2CLCK_EXTRACT(tmp);
+	l2_clk = cpu_clk / l2_ratio;
+
+	ddr_ratio = tmp & MSAR_DDRCLCK_RTIO_MASK;
+	ddr_ratio = ddr_ratio >> 5;
+	if (ddr_ratio == 4)
+		sys_clk = 400;
+
+	switch (tmp & MSAR_TCLCK_MASK) {
+	case MSAR_TCLCK_167:
+		t_clk = MV_BOARD_TCLK_166MHZ;
+		break;
+	case MSAR_TCLCK_200:
+		t_clk = MV_BOARD_TCLK_200MHZ;

arch/arm/cpu/arm926ejs/kirkwood/cpu.c int print_cpuinfo(void) · line 344

Quoted 10 lines
arch/arm/cpu/arm926ejs/kirkwood/cpu.c +10 -0
+		break;
+	default:
+		t_clk = MV_BOARD_TCLK_200MHZ;
+		break;
+	}
+
+	printf("CPU running @ %dMHz L2 running @ %dMHz\n",
+		cpu_clk, l2_clk);
+	printf("SysClock = %dMHz, TClock = %dMHz\n",
+		sys_clk, t_clk / 1000000);

It is good to encapsulate this in #ifdef CONFIG_SYS_XXX

Quoted 10 lines
arch/arm/cpu/arm926ejs/kirkwood/cpu.c +1 -0
+
 	return 0;
 }
 #endif /* CONFIG_DISPLAY_CPUINFO */
arch/arm/include/asm/arch-kirkwood/cpu.h +0 -0
index d28c51a..28ddd25 100644

arch/arm/include/asm/arch-kirkwood/cpu.h

Quoted 8 lines
arch/arm/include/asm/arch-kirkwood/cpu.h +1 -1
@@ -41,6 +41,7 @@
 #define KW_REG_SYSRST_CNT		(KW_MPP_BASE + 0x50)
 #define SYSRST_CNT_1SEC_VAL		(25*1000000)
 #define KW_REG_MPP_OUT_DRV_REG		(KW_MPP_BASE + 0xE0)
+#define MPP_SAMPLE_AT_RESET		(KW_MPP_BASE + 0x30)
 
 enum memory_bank {
 	BANK0,
--

Regards..
Prafulla . .

Quoted 1 line

1.7.0.4

author
#34 lore raw

[U-Boot] RFC [PATCH 2/5] arm/kirkwood: print speeds with cpu info.

Quoted 26 lines · Prafulla Wadaskar
Quoted 26 lines

-----Original Message-----
From: Jason Cooper [mailto:u-boot at lakedaemon.net]
Sent: Wednesday, July 27, 2011 2:49 AM
To: clint at debian.org; wd at denx.de; Prafulla Wadaskar
Cc: u-boot at lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale at gag.com; Jason Cooper
Subject: RFC [PATCH 2/5] arm/kirkwood: print speeds with cpu info.

---
 arch/arm/cpu/arm926ejs/kirkwood/cpu.c    |   46
++++++++++++++++++++++++++++++
 arch/arm/include/asm/arch-kirkwood/cpu.h |    1 +
 2 files changed, 47 insertions(+), 0 deletions(-)
arch/arm/cpu/arm926ejs/kirkwood/cpu.c +0 -0
index b4a4c04..a69f9f2 100644
@@ -270,11 +270,26 @@ static void kw_sysrst_check(void)
 }
 
Quoted 16 lines
Quoted 4 lines
arch/arm/cpu/arm926ejs/kirkwood/cpu.c +2 -0
 #if defined(CONFIG_DISPLAY_CPUINFO)
+#define MSAR_CPUCLCK_EXTRACT(X)	(((X & 0x2) >> 1) | ((X & 0x400000) >>
 21) | \
+				((X & 0x18) >> 1))

arch/arm/cpu/arm926ejs/kirkwood/cpu.c static void kw_sysrst_check(void) · line 283

Quoted 10 lines
arch/arm/cpu/arm926ejs/kirkwood/cpu.c +9 -0
+#define MSAR_L2CLCK_EXTRACT(X)  (((X & 0x600) >> 9) | ((X & 0x80000) >>
 17))
+#define MSAR_DDRCLCK_RTIO_MASK  (0xf << 5)
+
+#define MSAR_TCLCK_OFFS		21
+#define MSAR_TCLCK_MASK		(0x1 << MSAR_TCLCK_OFFS)
+#define MV_BOARD_TCLK_166MHZ	166666667
+#define MV_BOARD_TCLK_200MHZ	200000000
+#define MSAR_TCLCK_167		(0x1 << MSAR_TCLCK_OFFS)
+#define MSAR_TCLCK_200		(0x0 << MSAR_TCLCK_OFFS)

There are one time used macros, can they be optimized?

Sure, do you prefer a static assignment:

#define MSAR_TCLCK_166 0x00200000

or, just do away with it altogether and use the number?

Quoted 41 lines
Quoted 41 lines
arch/arm/cpu/arm926ejs/kirkwood/cpu.c +4 -0
+
 int print_cpuinfo(void)
 {
 	char *rev;
 	u16 devid = (readl(KW_REG_PCIE_DEVID) >> 16) & 0xffff;
 	u8 revid = readl(KW_REG_PCIE_REVID) & 0xff;
+	u32 cpu_clk, t_clk, tmp;
+	u32 sys_clk, l2_clk;
+	u32 l2_ratio, ddr_ratio;
 
arch/arm/cpu/arm926ejs/kirkwood/cpu.c +0 -0
 	if ((readl(KW_REG_DEVICE_ID) & 0x03) > 2) {
 		printf("Error.. %s:Unsupported Kirkwood SoC 88F%04x\n",

__FUNCTION__, devid);

arch/arm/cpu/arm926ejs/kirkwood/cpu.c +24 -0
@@ -297,6 +312,37 @@ int print_cpuinfo(void)
 	}
 
 	printf("SoC:   Kirkwood 88F%04x_%s\n", devid, rev);
+
+	tmp = readl(MPP_SAMPLE_AT_RESET);
+	cpu_clk = MSAR_CPUCLCK_EXTRACT(tmp);
+	if (cpu_clk == 0x9)
+		cpu_clk = 1200;
+
+	l2_ratio = MSAR_L2CLCK_EXTRACT(tmp);
+	l2_clk = cpu_clk / l2_ratio;
+
+	ddr_ratio = tmp & MSAR_DDRCLCK_RTIO_MASK;
+	ddr_ratio = ddr_ratio >> 5;
+	if (ddr_ratio == 4)
+		sys_clk = 400;
+
+	switch (tmp & MSAR_TCLCK_MASK) {
+	case MSAR_TCLCK_167:
+		t_clk = MV_BOARD_TCLK_166MHZ;
+		break;
+	case MSAR_TCLCK_200:
+		t_clk = MV_BOARD_TCLK_200MHZ;
+		break;
+	default:
+		t_clk = MV_BOARD_TCLK_200MHZ;
+		break;
Quoted 8 lines

arch/arm/cpu/arm926ejs/kirkwood/cpu.c int print_cpuinfo(void) · line 344

Quoted 6 lines
arch/arm/cpu/arm926ejs/kirkwood/cpu.c +6 -0
+	}
+
+	printf("CPU running @ %dMHz L2 running @ %dMHz\n",
+		cpu_clk, l2_clk);
+	printf("SysClock = %dMHz, TClock = %dMHz\n",
+		sys_clk, t_clk / 1000000);

It is good to encapsulate this in #ifdef CONFIG_SYS_XXX

It's already encapsulated in CONFIG_DISPLAY_CPUINFO, so if enabled, on boot it looks like:

SoC: Kirkwood 88F6281_A1
CPU running @ 1200MHz L2 running @ 400MHz
SysClock = 400MHz, TClock = 200MHz

I can encapsulate it separately if you want, but it seems a little too fine grained for me. Either I want cpu info, or I don't. ymmv.

thx,

Jason.

#35 lore raw

[U-Boot] RFC [PATCH 2/5] arm/kirkwood: print speeds with cpu info.

Quoted 57 lines

-----Original Message-----
From: Jason [mailto:u-boot at lakedaemon.net]
Sent: Thursday, July 28, 2011 7:02 AM
To: Prafulla Wadaskar
Cc: clint at debian.org; wd at denx.de; u-boot at lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale at gag.com
Subject: Re: RFC [PATCH 2/5] arm/kirkwood: print speeds with cpu info.

Quoted 7 lines · Prafulla Wadaskar
Quoted 7 lines

-----Original Message-----
From: Jason Cooper [mailto:u-boot at lakedaemon.net]
Sent: Wednesday, July 27, 2011 2:49 AM
To: clint at debian.org; wd at denx.de; Prafulla Wadaskar
Cc: u-boot at lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare;

Siddarth

Quoted 19 lines
Quoted 19 lines

Gore; bdale at gag.com; Jason Cooper
Subject: RFC [PATCH 2/5] arm/kirkwood: print speeds with cpu info.

---
 arch/arm/cpu/arm926ejs/kirkwood/cpu.c    |   46
++++++++++++++++++++++++++++++
 arch/arm/include/asm/arch-kirkwood/cpu.h |    1 +
 2 files changed, 47 insertions(+), 0 deletions(-)
arch/arm/cpu/arm926ejs/kirkwood/cpu.c +0 -0
index b4a4c04..a69f9f2 100644
@@ -270,11 +270,26 @@ static void kw_sysrst_check(void)
 }
 
Quoted 2 lines

arch/arm/cpu/arm926ejs/kirkwood/cpu.c static void kw_sysrst_check(void) · line 273

Quoted 2 lines
arch/arm/cpu/arm926ejs/kirkwood/cpu.c +1 -0
 #if defined(CONFIG_DISPLAY_CPUINFO)
+#define MSAR_CPUCLCK_EXTRACT(X)	(((X & 0x2) >> 1) | ((X &

0x400000) >>

Quoted 3 lines

arch/arm/cpu/arm926ejs/kirkwood/cpu.c static void kw_sysrst_check(void) · line 276

Quoted 3 lines
arch/arm/cpu/arm926ejs/kirkwood/cpu.c +2 -0
 21) | \
+				((X & 0x18) >> 1))
+#define MSAR_L2CLCK_EXTRACT(X)  (((X & 0x600) >> 9) | ((X &

0x80000) >>

Quoted 11 lines

arch/arm/cpu/arm926ejs/kirkwood/cpu.c static void kw_sysrst_check(void) · line 283

Quoted 9 lines
arch/arm/cpu/arm926ejs/kirkwood/cpu.c +8 -0
 17))
+#define MSAR_DDRCLCK_RTIO_MASK  (0xf << 5)
+
+#define MSAR_TCLCK_OFFS		21
+#define MSAR_TCLCK_MASK		(0x1 << MSAR_TCLCK_OFFS)
+#define MV_BOARD_TCLK_166MHZ	166666667
+#define MV_BOARD_TCLK_200MHZ	200000000
+#define MSAR_TCLCK_167		(0x1 << MSAR_TCLCK_OFFS)
+#define MSAR_TCLCK_200		(0x0 << MSAR_TCLCK_OFFS)

There are one time used macros, can they be optimized?

Quoted 3 lines

Sure, do you prefer a static assignment:

#define MSAR_TCLCK_166 0x00200000

This is okay with some comments.

Quoted 56 lines

or, just do away with it altogether and use the number?

Quoted 41 lines
Quoted 41 lines
arch/arm/cpu/arm926ejs/kirkwood/cpu.c +4 -0
+
 int print_cpuinfo(void)
 {
 	char *rev;
 	u16 devid = (readl(KW_REG_PCIE_DEVID) >> 16) & 0xffff;
 	u8 revid = readl(KW_REG_PCIE_REVID) & 0xff;
+	u32 cpu_clk, t_clk, tmp;
+	u32 sys_clk, l2_clk;
+	u32 l2_ratio, ddr_ratio;
 
arch/arm/cpu/arm926ejs/kirkwood/cpu.c +0 -0
 	if ((readl(KW_REG_DEVICE_ID) & 0x03) > 2) {
 		printf("Error.. %s:Unsupported Kirkwood SoC 88F%04x\n",

__FUNCTION__, devid);

arch/arm/cpu/arm926ejs/kirkwood/cpu.c +24 -0
@@ -297,6 +312,37 @@ int print_cpuinfo(void)
 	}
 
 	printf("SoC:   Kirkwood 88F%04x_%s\n", devid, rev);
+
+	tmp = readl(MPP_SAMPLE_AT_RESET);
+	cpu_clk = MSAR_CPUCLCK_EXTRACT(tmp);
+	if (cpu_clk == 0x9)
+		cpu_clk = 1200;
+
+	l2_ratio = MSAR_L2CLCK_EXTRACT(tmp);
+	l2_clk = cpu_clk / l2_ratio;
+
+	ddr_ratio = tmp & MSAR_DDRCLCK_RTIO_MASK;
+	ddr_ratio = ddr_ratio >> 5;
+	if (ddr_ratio == 4)
+		sys_clk = 400;
+
+	switch (tmp & MSAR_TCLCK_MASK) {
+	case MSAR_TCLCK_167:
+		t_clk = MV_BOARD_TCLK_166MHZ;
+		break;
+	case MSAR_TCLCK_200:
+		t_clk = MV_BOARD_TCLK_200MHZ;
+		break;
+	default:
+		t_clk = MV_BOARD_TCLK_200MHZ;
+		break;
Quoted 8 lines

arch/arm/cpu/arm926ejs/kirkwood/cpu.c int print_cpuinfo(void) · line 344

Quoted 6 lines
arch/arm/cpu/arm926ejs/kirkwood/cpu.c +6 -0
+	}
+
+	printf("CPU running @ %dMHz L2 running @ %dMHz\n",
+		cpu_clk, l2_clk);
+	printf("SysClock = %dMHz, TClock = %dMHz\n",
+		sys_clk, t_clk / 1000000);

It is good to encapsulate this in #ifdef CONFIG_SYS_XXX

It's already encapsulated in CONFIG_DISPLAY_CPUINFO, so if enabled, on boot it looks like:

Quoted 6 lines

SoC: Kirkwood 88F6281_A1
CPU running @ 1200MHz L2 running @ 400MHz
SysClock = 400MHz, TClock = 200MHz

I can encapsulate it separately if you want, but it seems a little too fine grained for me. Either I want cpu info, or I don't. ymmv.

I think you are right, this should be okay, anyway it displays useful information. Sorry for this noisy comments.

Regards..
Prafulla . .

#36 lore raw

[U-Boot] RFC [PATCH 2/5] arm/kirkwood: print speeds with cpu info.

In reply to Jason Cooper

Dear Jason Cooper,

Quoted 1 line · In message <[email protected]> you wrote:

...

arch/arm/cpu/arm926ejs/kirkwood/cpu.c int print_cpuinfo(void) · line 344

Quoted 4 lines
arch/arm/cpu/arm926ejs/kirkwood/cpu.c +4 -0
+	printf("CPU running @ %dMHz L2 running @ %dMHz\n",
+		cpu_clk, l2_clk);
+	printf("SysClock = %dMHz, TClock = %dMHz\n",
+		sys_clk, t_clk / 1000000);

Please use strmhz() to format the frequencies.

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
Just because your doctor has a name for your condition  doesn't  mean
he knows what it is.
author
#37 lore raw

[U-Boot] RFC [PATCH 2/5] arm/kirkwood: print speeds with cpu info.

Wolfgang,

Quoted 8 lines · Wolfgang Denk

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

arch/arm/cpu/arm926ejs/kirkwood/cpu.c int print_cpuinfo(void) · line 344

Quoted 4 lines
arch/arm/cpu/arm926ejs/kirkwood/cpu.c +4 -0
+	printf("CPU running @ %dMHz L2 running @ %dMHz\n",
+		cpu_clk, l2_clk);
+	printf("SysClock = %dMHz, TClock = %dMHz\n",
+		sys_clk, t_clk / 1000000);

Please use strmhz() to format the frequencies.

Will do, however, please be aware that this patch has been set aside. I not familiar enough with all the variants to do it properly, and it was purely informative.

If somebody expresses an interest, or offers to help, I'll resume work on it at a later date.

thx,

Jason.

#38 lore raw

[U-Boot] RFC [PATCH 3/5] usb: Some EHCI chipsets are slow to respond.

In reply to u-boot at lakedaemon.net

This fixes 'EHCI timed out on TD...' on the dreamplug board.

---
 include/usb.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/usb.h +1 -1
index 53603a5..168e2b2 100644
@@ -46,7 +46,7 @@
  * This is the timeout to allow for submitting an urb in ms. We allow more
  * time for a BULK device to react - some are slow.
  */
-#define USB_TIMEOUT_MS(pipe) (usb_pipebulk(pipe) ? 5000 : 100)
+#define USB_TIMEOUT_MS(pipe) (usb_pipebulk(pipe) ? 5000 : 500)
 
 /* device request (setup) */
 struct devrequest {
Signature · 1 line
1.7.0.4
#39 lore raw

[U-Boot] RFC [PATCH 3/5] usb: Some EHCI chipsets are slow to respond.

Quoted 26 lines

-----Original Message-----
From: Jason Cooper [mailto:u-boot at lakedaemon.net]
Sent: Wednesday, July 27, 2011 2:49 AM
To: clint at debian.org; wd at denx.de; Prafulla Wadaskar
Cc: u-boot at lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale at gag.com; Jason Cooper
Subject: RFC [PATCH 3/5] usb: Some EHCI chipsets are slow to respond.

This fixes 'EHCI timed out on TD...' on the dreamplug board.

---
 include/usb.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/usb.h +0 -0
index 53603a5..168e2b2 100644
@@ -46,7 +46,7 @@
  * This is the timeout to allow for submitting an urb in ms. We allow

more
* time for a BULK device to react - some are slow. */

include/usb.h line 49

Quoted 2 lines
include/usb.h +1 -1
-#define USB_TIMEOUT_MS(pipe) (usb_pipebulk(pipe) ? 5000 : 100)
+#define USB_TIMEOUT_MS(pipe) (usb_pipebulk(pipe) ? 5000 : 500)

This looks global change, how will it affect other implementations?

Regards..
Prafulla . .

author
#40 lore raw

[U-Boot] RFC [PATCH 3/5] usb: Some EHCI chipsets are slow to respond.

Quoted 17 lines · Prafulla Wadaskar
Quoted 17 lines

-----Original Message-----
From: Jason Cooper [mailto:u-boot at lakedaemon.net]
Sent: Wednesday, July 27, 2011 2:49 AM
To: clint at debian.org; wd at denx.de; Prafulla Wadaskar
Cc: u-boot at lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale at gag.com; Jason Cooper
Subject: RFC [PATCH 3/5] usb: Some EHCI chipsets are slow to respond.

This fixes 'EHCI timed out on TD...' on the dreamplug board.

---
 include/usb.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 13 lines

include/usb.h line 49

Quoted 11 lines
include/usb.h +0 -0
index 53603a5..168e2b2 100644
@@ -46,7 +46,7 @@
  * This is the timeout to allow for submitting an urb in ms. We allow

more
* time for a BULK device to react - some are slow. */

include/usb.h +1 -1
-#define USB_TIMEOUT_MS(pipe) (usb_pipebulk(pipe) ? 5000 : 100)
+#define USB_TIMEOUT_MS(pipe) (usb_pipebulk(pipe) ? 5000 : 500)

This looks global change, how will it affect other implementations?

I dunno, that's why it's RFC. ;-) It's a timeout, so it *shouldn't* adversely affect other systems with well behaved usb chipsets. And boards will ill-tempered usb chipsets should work better. But I'm not familiar enough with the usb code to say that definitively.

I could try doing a dreamplug-specific hack to make it work, but if there's no adverse affect to other systems, then this is a cleaner approach.

thx,

Jason.

#41 lore raw

[U-Boot] RFC [PATCH 3/5] usb: Some EHCI chipsets are slow to respond.

Quoted 46 lines

-----Original Message-----
From: Jason [mailto:u-boot at lakedaemon.net]
Sent: Thursday, July 28, 2011 7:07 AM
To: Prafulla Wadaskar
Cc: clint at debian.org; wd at denx.de; u-boot at lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale at gag.com
Subject: Re: RFC [PATCH 3/5] usb: Some EHCI chipsets are slow to respond.

Quoted 7 lines · Prafulla Wadaskar
Quoted 7 lines

-----Original Message-----
From: Jason Cooper [mailto:u-boot at lakedaemon.net]
Sent: Wednesday, July 27, 2011 2:49 AM
To: clint at debian.org; wd at denx.de; Prafulla Wadaskar
Cc: u-boot at lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare;

Siddarth

Quoted 2 lines
Quoted 2 lines

Gore; bdale at gag.com; Jason Cooper
Subject: RFC [PATCH 3/5] usb: Some EHCI chipsets are slow to

respond.

Quoted 8 lines
Quoted 8 lines

This fixes 'EHCI timed out on TD...' on the dreamplug board.

---
 include/usb.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 6 lines

include/usb.h line 46

Quoted 6 lines
include/usb.h +0 -0
index 53603a5..168e2b2 100644
@@ -46,7 +46,7 @@
  * This is the timeout to allow for submitting an urb in ms. We

allow

Quoted 7 lines

include/usb.h line 49

Quoted 5 lines

more
* time for a BULK device to react - some are slow. */

include/usb.h +1 -1
-#define USB_TIMEOUT_MS(pipe) (usb_pipebulk(pipe) ? 5000 : 100)
+#define USB_TIMEOUT_MS(pipe) (usb_pipebulk(pipe) ? 5000 : 500)

This looks global change, how will it affect other implementations?

Quoted 8 lines

I dunno, that's why it's RFC. ;-) It's a timeout, so it *shouldn't* adversely affect other systems with well behaved usb chipsets. And boards will ill-tempered usb chipsets should work better. But I'm not familiar enough with the usb code to say that definitively.

I could try doing a dreamplug-specific hack to make it work, but if there's no adverse affect to other systems, then this is a cleaner approach.

You can post this standalone patch, remove from this patch series since it will be acked/applied by other custodian.

Regards..
Prafulla . .

author
#42 lore raw

[U-Boot] RFC [PATCH 3/5] usb: Some EHCI chipsets are slow to respond.

Quoted 47 lines · Prafulla Wadaskar
Quoted 47 lines

-----Original Message-----
From: Jason [mailto:u-boot at lakedaemon.net]
Sent: Thursday, July 28, 2011 7:07 AM
To: Prafulla Wadaskar
Cc: clint at debian.org; wd at denx.de; u-boot at lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale at gag.com
Subject: Re: RFC [PATCH 3/5] usb: Some EHCI chipsets are slow to respond.

Quoted 5 lines · Prafulla Wadaskar
Quoted 5 lines

-----Original Message-----
From: Jason Cooper [mailto:u-boot at lakedaemon.net]
Sent: Wednesday, July 27, 2011 2:49 AM
To: clint at debian.org; wd at denx.de; Prafulla Wadaskar
Cc: u-boot at lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare;

Siddarth

Quoted 2 lines
Quoted 2 lines

Gore; bdale at gag.com; Jason Cooper
Subject: RFC [PATCH 3/5] usb: Some EHCI chipsets are slow to

respond.

Quoted 8 lines
Quoted 8 lines

This fixes 'EHCI timed out on TD...' on the dreamplug board.

---
 include/usb.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 6 lines

include/usb.h line 46

Quoted 6 lines
include/usb.h +0 -0
index 53603a5..168e2b2 100644
@@ -46,7 +46,7 @@
  * This is the timeout to allow for submitting an urb in ms. We

allow

Quoted 7 lines

include/usb.h line 49

Quoted 5 lines

more
* time for a BULK device to react - some are slow. */

include/usb.h +1 -1
-#define USB_TIMEOUT_MS(pipe) (usb_pipebulk(pipe) ? 5000 : 100)
+#define USB_TIMEOUT_MS(pipe) (usb_pipebulk(pipe) ? 5000 : 500)

This looks global change, how will it affect other implementations?

I dunno, that's why it's RFC. ;-) It's a timeout, so it *shouldn't* adversely affect other systems with well behaved usb chipsets. And boards will ill-tempered usb chipsets should work better. But I'm not familiar enough with the usb code to say that definitively.

Quoted 6 lines
Quoted 3 lines

I could try doing a dreamplug-specific hack to make it work, but if there's no adverse affect to other systems, then this is a cleaner approach.

You can post this standalone patch, remove from this patch series since it will be acked/applied by other custodian.

Based on new info (the OpenRD-ultimate is experiencing the same bug), a git bisect has revealed the following patch as the culprit:

commit c2dd0d45540397704de9b13287417d21049d34c6

Author: Aneesh V <[email protected]>
Date:   Thu Jun 16 23:30:49 2011 +0000

armv7: integrate cache maintenance support

- Enable I-cache on bootup
- Enable MMU and D-cache immediately after relocation
- Do necessary initialization before enabling d-cache and MMU
- Changes to cleanup_before_linux()
- Make changes according to the new framework

The reporter was also able to verify that reverting this patch fixed reading from the internal usb attached microsd card. I'd be lying if I said I understood how.

I think the problem is in one of two areas. Either the patch is incorrect, or it's fix highlighted a bug in the marvell EHCI code. I'll add some folks to the CC who can add more intelligent thoughts. :-)

You can see his error report here [1] which is the exact same error messages I was trying to fix after giving the command 'usb start'.

thx,

Jason.

[1] http://lists.denx.de/pipermail/u-boot/2011-July/097333.html

#43 lore raw

[U-Boot] RFC [PATCH 4/5 v5] dreamplug: initial board support.

In reply to u-boot at lakedaemon.net

Copied wholeheartedly from board/Marvell/guruplug and modified to add support for SPI NOR flash.

Also, the following features are used:
- Use the Marvell Integrated RTC.
- display Marvell CPU/L2/etc speeds if requested.

Note: this still uses MACH_TYPE_GURUPLUG until MACH_TYPE_DREAMPLUG is accepted into mainline Linux. The source from Globalscale did the same.

---
 MAINTAINERS                          |    4 +
 MAKEALL                              |    1 +
 board/Marvell/dreamplug/Makefile     |   54 +++++++++++
 board/Marvell/dreamplug/dreamplug.c  |  157 ++++++++++++++++++++++++++++++++
 board/Marvell/dreamplug/dreamplug.h  |   42 +++++++++
 board/Marvell/dreamplug/kwbimage.cfg |  163 ++++++++++++++++++++++++++++++++++
 boards.cfg                           |    1 +
 include/configs/dreamplug.h          |  138 ++++++++++++++++++++++++++++
 8 files changed, 560 insertions(+), 0 deletions(-)
 create mode 100644 board/Marvell/dreamplug/Makefile
 create mode 100644 board/Marvell/dreamplug/dreamplug.c
 create mode 100644 board/Marvell/dreamplug/dreamplug.h
 create mode 100644 board/Marvell/dreamplug/kwbimage.cfg
 create mode 100644 include/configs/dreamplug.h
MAINTAINERS +4 -0
index 2bba7b4..9affbea 100644
@@ -70,6 +70,10 @@ Conn Clark <[email protected]>
 
 	ESTEEM192E	MPC8xx
 
+Jason Cooper <[email protected]>
+
+	dreamplug	ARM926EJS (Kirkwood SoC)
+
 Joe D'Abbraccio <[email protected]>
 
 	MPC837xERDB	MPC837x
MAKEALL +1 -0
index 51db13e..55a122f 100755
@@ -335,6 +335,7 @@ LIST_ARM9="			\
 	cp966			\
 	da830evm		\
 	da850evm		\
+	dreamplug		\
 	edb9301			\
 	edb9302			\
 	edb9302a		\
board/Marvell/dreamplug/Makefile new file +54 -0

54 lines not on this page · raw message

board/Marvell/dreamplug/dreamplug.c new file +157 -0

157 lines not on this page · raw message

board/Marvell/dreamplug/dreamplug.h new file +42 -0

42 lines not on this page · raw message

board/Marvell/dreamplug/kwbimage.cfg new file +163 -0

163 lines not on this page · raw message

boards.cfg +1 -0
index dfefc3f..294c675 100644
@@ -118,6 +118,7 @@ davinci_sonata               arm         arm926ejs   sonata              davinci
 suen3                        arm         arm926ejs   km_arm              keymile        kirkwood
 suen8                        arm         arm926ejs   km_arm              keymile        kirkwood
 mgcoge3un                    arm         arm926ejs   km_arm              keymile        kirkwood
+dreamplug                    arm         arm926ejs   -                   Marvell        kirkwood
 guruplug                     arm         arm926ejs   -                   Marvell        kirkwood
 mv88f6281gtw_ge              arm         arm926ejs   -                   Marvell        kirkwood
 openrd_base                  arm         arm926ejs   openrd              Marvell        kirkwood        openrd:BOARD_IS_OPENRD_BASE
include/configs/dreamplug.h new file +138 -0

138 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#44 lore raw

[U-Boot] RFC [PATCH 4/5 v5] dreamplug: initial board support.

Quoted 18 lines

-----Original Message-----
From: Jason Cooper [mailto:u-boot at lakedaemon.net]
Sent: Wednesday, July 27, 2011 2:49 AM
To: clint at debian.org; wd at denx.de; Prafulla Wadaskar
Cc: u-boot at lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale at gag.com; Jason Cooper
Subject: RFC [PATCH 4/5 v5] dreamplug: initial board support.

Copied wholeheartedly from board/Marvell/guruplug and modified to add support
for SPI NOR flash.

Also, the following features are used:
- Use the Marvell Integrated RTC.
- display Marvell CPU/L2/etc speeds if requested.

Quoted 6 lines

Note: this still uses MACH_TYPE_GURUPLUG until MACH_TYPE_DREAMPLUG is accepted
into mainline Linux. The source from Globalscale did the same.

---

There is no change log for all previous versions.
Please put them here.
Ref: http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions

Quoted 202 lines
 MAINTAINERS                          |    4 +
 MAKEALL                              |    1 +
 board/Marvell/dreamplug/Makefile     |   54 +++++++++++
 board/Marvell/dreamplug/dreamplug.c  |  157
++++++++++++++++++++++++++++++++
 board/Marvell/dreamplug/dreamplug.h  |   42 +++++++++
 board/Marvell/dreamplug/kwbimage.cfg |  163
++++++++++++++++++++++++++++++++++
 boards.cfg                           |    1 +
 include/configs/dreamplug.h          |  138
++++++++++++++++++++++++++++
 8 files changed, 560 insertions(+), 0 deletions(-)
 create mode 100644 board/Marvell/dreamplug/Makefile
 create mode 100644 board/Marvell/dreamplug/dreamplug.c
 create mode 100644 board/Marvell/dreamplug/dreamplug.h
 create mode 100644 board/Marvell/dreamplug/kwbimage.cfg
 create mode 100644 include/configs/dreamplug.h
MAINTAINERS +4 -0
index 2bba7b4..9affbea 100644
@@ -70,6 +70,10 @@ Conn Clark <[email protected]>
 
      ESTEEM192E      MPC8xx
 
+Jason Cooper <[email protected]>
+
+     dreamplug       ARM926EJS (Kirkwood SoC)
+
 Joe D'Abbraccio <[email protected]>
 
      MPC837xERDB     MPC837x
MAKEALL +1 -0
index 51db13e..55a122f 100755
@@ -335,6 +335,7 @@ LIST_ARM9="                       \
      cp966                   \
      da830evm                \
      da850evm                \
+     dreamplug               \
      edb9301                 \
      edb9302                 \
      edb9302a                \
board/Marvell/dreamplug/Makefile new file +47 -0
new file mode 100644
index 0000000..9ee5406
@@ -0,0 +1,54 @@
+#
+# (C) Copyright 2011
+# Jason Cooper <[email protected]>
+#
+# Based on work by:
+# Marvell Semiconductor <www.marvell.com>
+# Written-by: Siddarth Gore <[email protected]>
+#
+# 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., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB  = $(obj)lib$(BOARD).o
+
+COBJS        := dreamplug.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))
+
+clean:
+     rm -f $(SOBJS) $(OBJS)
+
+distclean:   clean
+     rm -f $(LIB) core *.bak .depend
+
+#######################################################################

##

board/Marvell/dreamplug/Makefile new file +7 -0
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#######################################################################

##

board/Marvell/dreamplug/dreamplug.c new file +87 -0
new file mode 100644
index 0000000..cdc094a
@@ -0,0 +1,157 @@
+/*
+ * (C) Copyright 2011
+ * Jason Cooper <[email protected]>
+ *
+ * Based on work by:
+ * Marvell Semiconductor <www.marvell.com>
+ * Written-by: Siddarth Gore <[email protected]>
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#include <common.h>
+#include <miiphy.h>
+#include <asm/arch/kirkwood.h>
+#include <asm/arch/mpp.h>
+#include "dreamplug.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int board_early_init_f(void)
+{
+     /*
+      * default gpio configuration
+      * There are maximum 64 gpios controlled through 2 sets of registers
+      * the  below configuration configures mainly initial LED status
+      */
+     kw_config_gpio(DREAMPLUG_OE_VAL_LOW,
+                     DREAMPLUG_OE_VAL_HIGH,
+                     DREAMPLUG_OE_LOW, DREAMPLUG_OE_HIGH);
+
+     /* Multi-Purpose Pins Functionality configuration */
+     u32 kwmpp_config[] = {
+             MPP0_SPI_SCn,           /* SPI Flash */
+             MPP1_SPI_MOSI,
+             MPP2_SPI_SCK,
+             MPP3_SPI_MISO,
+             MPP4_NF_IO6,
+             MPP5_NF_IO7,
+             MPP6_SYSRST_OUTn,
+             MPP7_GPO,
+             MPP8_TW_SDA,
+             MPP9_TW_SCK,
+             MPP10_UART0_TXD,        /* Serial */
+             MPP11_UART0_RXD,
+             MPP12_SD_CLK,           /* SDIO Slot */
+             MPP13_SD_CMD,
+             MPP14_SD_D0,
+             MPP15_SD_D1,
+             MPP16_SD_D2,
+             MPP17_SD_D3,
+             MPP18_NF_IO0,
+             MPP19_NF_IO1,
+             MPP20_GE1_0,            /* Gigabit Ethernet */
+             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,
+             MPP37_GPIO,
+             MPP38_GPIO,

board/Marvell/dreamplug/dreamplug.c line 97

Quoted 10 lines
board/Marvell/dreamplug/dreamplug.c new file +10 -0
+             MPP39_GPIO,
+             MPP40_TDM_SPI_SCK,
+             MPP41_TDM_SPI_MISO,
+             MPP42_TDM_SPI_MOSI,
+             MPP43_GPIO,
+             MPP44_GPIO,
+             MPP45_GPIO,
+             MPP46_GPIO,             /* Wifi AP LED */
+             MPP47_GPIO,
+             MPP48_GPIO,             /* Wifi LED */

It is better if you can comment about rest other GPIOSs with their assigned functionality.

Quoted 4 lines
board/Marvell/dreamplug/dreamplug.c new file +4 -0
+             MPP49_GPIO,
+             0
+     };
+     kirkwood_mpp_conf(kwmpp_config);

board/Marvell/dreamplug/dreamplug.c line 111

Quoted 10 lines
board/Marvell/dreamplug/dreamplug.c new file +10 -0
+     return 0;
+}
+
+int board_init(void)
+{
+     /*
+      * arch number of board
+      * XXX: change to MACH_TYPE_DREAMPLUG once in Linux mainline.
+      */
+     gd->bd->bi_arch_number = MACH_TYPE_GURUPLUG;

I think this board should have some delta to guruplug? I think you should have different machine ID here.

BTW: what is delta w.r.to guruplug?

Quoted 27 lines
board/Marvell/dreamplug/dreamplug.c new file +27 -0
+
+     /* adress of boot parameters */
+     gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;
+
+     return 0;
+}
+
+#ifdef CONFIG_RESET_PHY_R
+void mv_phy_88e1121_init(char *name)
+{
+     u16 reg;
+     u16 devadr;
+
+     if (miiphy_set_current_dev(name))
+             return;
+
+     /* command to read PHY dev address */
+     if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) {
+             printf("Err..%s could not read PHY dev address\n",
+                     __FUNCTION__);
+             return;
+     }
+
+     /*
+      * Enable RGMII delay on Tx and Rx for CPU port
+      * Ref: sec 4.7.2 of chip datasheet
+      */

board/Marvell/dreamplug/dreamplug.c line 148

Quoted 10 lines
board/Marvell/dreamplug/dreamplug.c new file +10 -0
+     miiphy_write(name, devadr, MV88E1121_PGADR_REG, 2);
+     miiphy_read(name, devadr, MV88E1121_MAC_CTRL2_REG, &reg);
+     reg |= (MV88E1121_RGMII_RXTM_CTRL | MV88E1121_RGMII_TXTM_CTRL);
+     miiphy_write(name, devadr, MV88E1121_MAC_CTRL2_REG, reg);
+     miiphy_write(name, devadr, MV88E1121_PGADR_REG, 0);
+
+     /* reset the phy */
+     miiphy_reset(name, devadr);
+
+     printf("88E1116 Initialized on %s\n", name);

Function name and print info are mismatching.

board/Marvell/dreamplug/kwbimage.cfg

Quoted 60 lines
board/Marvell/dreamplug/dreamplug.c new file +9 -0
+}
+
+void reset_phy(void)
+{
+     /* configure and initialize both PHY's */
+     mv_phy_88e1121_init("egiga0");
+     mv_phy_88e1121_init("egiga1");
+}
+#endif /* CONFIG_RESET_PHY_R */
board/Marvell/dreamplug/dreamplug.h new file +42 -0
new file mode 100644
index 0000000..21bf644
@@ -0,0 +1,42 @@
+/*
+ * (C) Copyright 2011
+ * Jason Cooper <[email protected]>
+ *
+ * Based on work by:
+ * Marvell Semiconductor <www.marvell.com>
+ * Written-by: Siddarth Gore <[email protected]>
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#ifndef __DREAMPLUG_H
+#define __DREAMPLUG_H
+
+#define DREAMPLUG_OE_LOW     (~(0))
+#define DREAMPLUG_OE_HIGH    (~(0))
+#define DREAMPLUG_OE_VAL_LOW 0
+#define DREAMPLUG_OE_VAL_HIGH        (0xf << 16) /* 4 LED Pins high */
+
+/* PHY related */
+#define MV88E1121_MAC_CTRL2_REG              21
+#define MV88E1121_PGADR_REG          22
+#define MV88E1121_RGMII_TXTM_CTRL    (1 << 4)
+#define MV88E1121_RGMII_RXTM_CTRL    (1 << 5)
+
+#endif /* __DREAMPLUG_H */
board/Marvell/dreamplug/kwbimage.cfg +0 -0

I hope this is not same as guruplug (since you are using same machine-id)?

Quoted 327 lines

new file mode 100644
index 0000000..ca9cd74

board/Marvell/dreamplug/kwbimage.cfg new file +55 -0
@@ -0,0 +1,163 @@
+#
+# (C) Copyright 2011
+# Jason Cooper <[email protected]>
+#
+# Based on work by:
+# Marvell Semiconductor <www.marvell.com>
+# Written-by: Siddarth Gore <[email protected]>
+#
+# 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., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+# Refer docs/README.kwimage for more details about how-to configure
+# and create kirkwood boot image
+#
+
+# Boot Media configurations
+BOOT_FROM    spi
+
+# SOC registers configuration using bootrom header extension
+# Maximum KWBIMAGE_MAX_CONFIG configurations allowed
+
+# Configure RGMII-0/1 interface pad voltage to 1.8V
+DATA 0xFFD100e0 0x1b1b9b9b
+
+#Dram initalization for SINGLE x16 CL=5 @ 400MHz
+DATA 0xFFD01400 0x43000c30   # DDR Configuration register
+# bit13-0:  0xc30 (3120 DDR2 clks refresh rate)
+# bit23-14: zero
+# bit24: 1= enable exit self refresh mode on DDR access
+# bit25: 1 required
+# bit29-26: zero
+# bit31-30: 01
+
+DATA 0xFFD01404 0x37543000   # DDR Controller Control Low
+# bit 4:    0=addr/cmd in smame cycle
+# bit 5:    0=clk is driven during self refresh, we don't care for APX
+# bit 6:    0=use recommended falling edge of clk for addr/cmd
+# bit14:    0=input buffer always powered up
+# bit18:    1=cpu lock transaction enabled
+# bit23-20: 5=recommended value for CL=5 and STARTBURST_DEL disabled

bit31=0
+# bit27-24: 7= CL+2, STARTBURST sample stages, for freqs 400MHz, unbuffered DIMM

board/Marvell/dreamplug/kwbimage.cfg new file +73 -0
+# bit30-28: 3 required
+# bit31:    0=no additional STARTBURST delay
+
+DATA 0xFFD01408 0x22125451   # DDR Timing (Low) (active cycles value
+1)
+# bit3-0:   TRAS lsbs
+# bit7-4:   TRCD
+# bit11- 8: TRP
+# bit15-12: TWR
+# bit19-16: TWTR
+# bit20:    TRAS msb
+# bit23-21: 0x0
+# bit27-24: TRRD
+# bit31-28: TRTP
+
+DATA 0xFFD0140C 0x00000a33   #  DDR Timing (High)
+# bit6-0:   TRFC
+# bit8-7:   TR2R
+# bit10-9:  TR2W
+# bit12-11: TW2W
+# bit31-13: zero required
+
+DATA 0xFFD01410 0x000000cc   #  DDR Address Control
+# bit1-0:   01, Cs0width=x8
+# bit3-2:   10, Cs0size=1Gb
+# bit5-4:   01, Cs1width=x8
+# bit7-6:   10, Cs1size=1Gb
+# bit9-8:   00, Cs2width=nonexistent
+# bit11-10: 00, Cs2size =nonexistent
+# bit13-12: 00, Cs3width=nonexistent
+# bit15-14: 00, Cs3size =nonexistent
+# bit16:    0,  Cs0AddrSel
+# bit17:    0,  Cs1AddrSel
+# bit18:    0,  Cs2AddrSel
+# bit19:    0,  Cs3AddrSel
+# bit31-20: 0 required
+
+DATA 0xFFD01414 0x00000000   #  DDR Open Pages Control
+# bit0:    0,  OpenPage enabled
+# bit31-1: 0 required
+
+DATA 0xFFD01418 0x00000000   #  DDR Operation
+# bit3-0:   0x0, DDR cmd
+# bit31-4:  0 required
+
+DATA 0xFFD0141C 0x00000C52   #  DDR Mode
+# bit2-0:   2, BurstLen=2 required
+# bit3:     0, BurstType=0 required
+# bit6-4:   4, CL=5
+# bit7:     0, TestMode=0 normal
+# bit8:     0, DLL reset=0 normal
+# bit11-9:  6, auto-precharge write recovery ????????????
+# bit12:    0, PD must be zero
+# bit31-13: 0 required
+
+DATA 0xFFD01420 0x00000040   #  DDR Extended Mode
+# bit0:    0,  DDR DLL enabled
+# bit1:    0,  DDR drive strenght normal
+# bit2:    0,  DDR ODT control lsd (disabled)
+# bit5-3:  000, required
+# bit6:    1,  DDR ODT control msb, (disabled)
+# bit9-7:  000, required
+# bit10:   0,  differential DQS enabled
+# bit11:   0, required
+# bit12:   0, DDR output buffer enabled
+# bit31-13: 0 required
+
+DATA 0xFFD01424 0x0000F17F   #  DDR Controller Control High
+# bit2-0:  111, required
+# bit3  :  1  , MBUS Burst Chop disabled
+# bit6-4:  111, required
+# bit7  :  0
+# bit8  :  1  , add writepath sample stage, must be 1 for DDR freq >=

300MHz

board/Marvell/dreamplug/kwbimage.cfg new file +35 -0
+# bit9  :  0  , no half clock cycle addition to dataout
+# bit10 :  0  , 1/4 clock cycle skew enabled for addr/ctl signals
+# bit11 :  0  , 1/4 clock cycle skew disabled for write mesh
+# bit15-12: 1111 required
+# bit31-16: 0    required
+
+DATA 0xFFD01428 0x00085520   # DDR2 ODT Read Timing (default values)
+DATA 0xFFD0147C 0x00008552   # DDR2 ODT Write Timing (default values)
+
+DATA 0xFFD01500 0x00000000   # CS[0]n Base address to 0x0
+DATA 0xFFD01504 0x0FFFFFF1   # CS[0]n Size
+# bit0:    1,  Window enabled
+# bit1:    0,  Write Protect disabled
+# bit3-2:  00, CS0 hit selected
+# bit23-4: ones, required
+# bit31-24: 0x0F, Size (i.e. 256MB)
+
+DATA 0xFFD01508 0x10000000   # CS[1]n Base address to 256Mb
+DATA 0xFFD0150C 0x0FFFFFF5   # CS[1]n Size 256Mb Window enabled for CS1
+
+DATA 0xFFD01514 0x00000000   # CS[2]n Size, window disabled
+DATA 0xFFD0151C 0x00000000   # CS[3]n Size, window disabled
+
+DATA 0xFFD01494 0x00030000   #  DDR ODT Control (Low)
+DATA 0xFFD01498 0x00000000   #  DDR ODT Control (High)
+# bit1-0:  00, ODT0 controlled by ODT Control (low) register above
+# bit3-2:  01, ODT1 active NEVER!
+# bit31-4: zero, required
+
+DATA 0xFFD0149C 0x0000E803   # CPU ODT Control
+DATA 0xFFD01480 0x00000001   # DDR Initialization Control
+#bit0=1, enable DDR init upon this register write
+
+# End of Header extension
+DATA 0x0 0x0
boards.cfg +0 -0
index dfefc3f..294c675 100644
@@ -118,6 +118,7 @@ davinci_sonata               arm         arm926ejs

sonata davinci
suen3 arm arm926ejs km_arm
keymile kirkwood
suen8 arm arm926ejs km_arm
keymile kirkwood
mgcoge3un arm arm926ejs km_arm
keymile kirkwood
+dreamplug arm arm926ejs -
Marvell kirkwood
guruplug arm arm926ejs -
Marvell kirkwood
mv88f6281gtw_ge arm arm926ejs -
Marvell kirkwood
openrd_base arm arm926ejs openrd
Marvell kirkwood openrd:BOARD_IS_OPENRD_BASE

include/configs/dreamplug.h new file +129 -0
new file mode 100644
index 0000000..2a908f4
@@ -0,0 +1,138 @@
+/*
+ * (C) Copyright 2011
+ * Jason Cooper <[email protected]>
+ *
+ * Based on work by:
+ * Marvell Semiconductor <www.marvell.com>
+ * Written-by: Siddarth Gore <[email protected]>
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#ifndef _CONFIG_DREAMPLUG_H
+#define _CONFIG_DREAMPLUG_H
+
+/*
+ * Version number information
+ */
+#define CONFIG_IDENT_STRING  "\nMarvell-DreamPlug"
+
+/*
+ * High Level Configuration Options (easy to change)
+ */
+#define CONFIG_SHEEVA_88SV131        1       /* CPU Core subversion */
+#define CONFIG_KIRKWOOD              1       /* SOC Family Name */
+#define CONFIG_KW88F6281     1       /* SOC Name */
+#define CONFIG_MACH_GURUPLUG /* Machine type */
+#define CONFIG_SKIP_LOWLEVEL_INIT    /* disable board lowlevel_init */
+
+/*
+ * Commands configuration
+ */
+#define CONFIG_SYS_NO_FLASH          /* Declare no flash (NOR/SPI) */
+#include <config_cmd_default.h>
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_SF
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_USB
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_DATE
+
+/*
+ * mv-common.h should be defined after CMD configs since it used them
+ * to enable certain macros
+ */
+#include "mv-common.h"
+
+/*
+ *  Environment variables configurations
+ */
+#ifdef CONFIG_SPI_FLASH
+#define CONFIG_ENV_IS_IN_SPI_FLASH   1
+#define CONFIG_ENV_SECT_SIZE         0x10000 /* 64k */
+#else
+#define CONFIG_ENV_IS_NOWHERE                1       /* if env in SDRAM */
+#endif
+
+#ifdef CONFIG_CMD_SF
+#define CONFIG_SPI_FLASH             1
+#define CONFIG_HARD_SPI                      1
+#define CONFIG_KIRKWOOD_SPI          1
+#define CONFIG_SPI_FLASH_MACRONIX    1
+#define CONFIG_ENV_SPI_BUS           0
+#define CONFIG_ENV_SPI_CS            0
+#define CONFIG_ENV_SPI_MAX_HZ                50000000 /* 50 MHz */
+#endif
+
+/*
+ * max 4k env size is enough, but in case of nand
+ * it has to be rounded to sector size
+ */
+#define CONFIG_ENV_SIZE                      0x1000  /* 4k */
+#define CONFIG_ENV_ADDR                      0x100000
+#define CONFIG_ENV_OFFSET            0x100000 /* env starts here */
+
+/*
+ * Default environment variables
+ */
+#define CONFIG_BOOTCOMMAND           "setenv ethact egiga0; " \
+     "${x_bootcmd_ethernet}; setenv ethact egiga1; " \
+     "${x_bootcmd_ethernet}; ${x_bootcmd_usb}; ${x_bootcmd_kernel}; "\
+     "setenv bootargs ${x_bootargs} ${x_bootargs_root}; "    \
+     "bootm 0x6400000;"
+
+#define CONFIG_EXTRA_ENV_SETTINGS    \
+     "x_bootcmd_ethernet=ping 192.168.2.1\0" \
+     "x_bootcmd_usb=usb start\0"     \
+     "x_bootcmd_kernel=fatload usb 0 0x6400000 uImage\0" \
+     "x_bootargs=console=ttyS0,115200\0"     \
+     "x_bootargs_root=root=/dev/sda2 rootdelay=10\0"
+
+/*
+ * Ethernet Driver configuration
+ */
+#ifdef CONFIG_CMD_NET
+#define CONFIG_MVGBE_PORTS   {1, 1}  /* enable both ports */
+#define CONFIG_PHY_BASE_ADR  0
+#endif /* CONFIG_CMD_NET */
+
+/*
+ * SATA Driver configuration
+ */
+#ifdef CONFIG_MVSATA_IDE
+#define CONFIG_SYS_ATA_IDE0_OFFSET   MV_SATA_PORT0_OFFSET
+#endif /*CONFIG_MVSATA_IDE*/
+
+/*
+ * RTC driver configuration
+ */
+#ifdef CONFIG_CMD_DATE
+#define CONFIG_RTC_MVINTEG
+#endif /* CONFIG_CMD_DATE */

include/configs/dreamplug.h

Quoted 10 lines
include/configs/dreamplug.h new file +9 -1
+
+#define CONFIG_SYS_ALT_MEMTEST
+
+/*
+ * display enhanced info about the cpu at boot.
+ */
+#define CONFIG_DISPLAY_CPUINFO
+
+#endif /* _CONFIG_DREAMPLUG_H */
--

Regards..
Prafulla . .

Quoted 1 line

1.7.0.4

author
#45 lore raw

[U-Boot] RFC [PATCH 4/5 v5] dreamplug: initial board support.

Quoted 22 lines · Prafulla Wadaskar
Quoted 22 lines

-----Original Message-----
From: Jason Cooper [mailto:u-boot at lakedaemon.net]
Sent: Wednesday, July 27, 2011 2:49 AM
To: clint at debian.org; wd at denx.de; Prafulla Wadaskar
Cc: u-boot at lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale at gag.com; Jason Cooper
Subject: RFC [PATCH 4/5 v5] dreamplug: initial board support.

Copied wholeheartedly from board/Marvell/guruplug and modified to add support
for SPI NOR flash.

Also, the following features are used:
- Use the Marvell Integrated RTC.
- display Marvell CPU/L2/etc speeds if requested.

Note: this still uses MACH_TYPE_GURUPLUG until MACH_TYPE_DREAMPLUG is accepted
into mainline Linux. The source from Globalscale did the same.

Quoted 6 lines
Quoted 2 lines

---

There is no change log for all previous versions.
Please put them here.
Ref: http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions

%$#%@#. I knew I forgot something. Here it is:

Changes from v1 to v2:

- resorted series to move 'make all' support last.

Changes from v2 to v3:

- Use MACH_TYPE_GURUPLUG for now until dreamplug support is in Linux.
- Update MAINTAINERS.
- Collapse into one patch.

Changes from v3 to v4:

- update copyright info as recommended by Prafulla Wadaskar.
- maintain proper order in boards.cfg, MAINTAINERS, etc.
- label MPP's
- change back to MACH_TYPE_DREAMPLUG. This patch is just RFC until the Dreamplug is supported in Linux (and MACH_TYPE_
added).

Changes from v4 to v5:

- Complete rewrite due to receiving u-boot source indirectly from Global Scale Tech.
- Added driver for integrated RTC. (thx GST!)
- Added support for displaying CPU frequencies at boot. (thx GST!)
- Adjust USB timeout to handle dreamplug EHCI chipset.
- Cleaned up MPP registers based on Global Scale code. (thx GST!)
- broke out MACH_TYPE_DREAMPLUG changes since it's going to be a while until the Linux arm tree gets sorted and accepts new boards again. Since all Dreamplugs currently on the market set r1 to MACH_TYPE_GURUPLUG, this allows the board to be added to u-boot while waiting for Linux mainline. Once it's in Linux mainline, then the last patch can be integrated to use MACH_TYPE_DREAMPLUG.

Quoted 207 lines
Quoted 207 lines
 MAINTAINERS                          |    4 +
 MAKEALL                              |    1 +
 board/Marvell/dreamplug/Makefile     |   54 +++++++++++
 board/Marvell/dreamplug/dreamplug.c  |  157
++++++++++++++++++++++++++++++++
 board/Marvell/dreamplug/dreamplug.h  |   42 +++++++++
 board/Marvell/dreamplug/kwbimage.cfg |  163
++++++++++++++++++++++++++++++++++
 boards.cfg                           |    1 +
 include/configs/dreamplug.h          |  138
++++++++++++++++++++++++++++
 8 files changed, 560 insertions(+), 0 deletions(-)
 create mode 100644 board/Marvell/dreamplug/Makefile
 create mode 100644 board/Marvell/dreamplug/dreamplug.c
 create mode 100644 board/Marvell/dreamplug/dreamplug.h
 create mode 100644 board/Marvell/dreamplug/kwbimage.cfg
 create mode 100644 include/configs/dreamplug.h
MAINTAINERS +4 -0
index 2bba7b4..9affbea 100644
@@ -70,6 +70,10 @@ Conn Clark <[email protected]>
 
      ESTEEM192E      MPC8xx
 
+Jason Cooper <[email protected]>
+
+     dreamplug       ARM926EJS (Kirkwood SoC)
+
 Joe D'Abbraccio <[email protected]>
 
      MPC837xERDB     MPC837x
MAKEALL +1 -0
index 51db13e..55a122f 100755
@@ -335,6 +335,7 @@ LIST_ARM9="                       \
      cp966                   \
      da830evm                \
      da850evm                \
+     dreamplug               \
      edb9301                 \
      edb9302                 \
      edb9302a                \
board/Marvell/dreamplug/Makefile new file +47 -0
new file mode 100644
index 0000000..9ee5406
@@ -0,0 +1,54 @@
+#
+# (C) Copyright 2011
+# Jason Cooper <[email protected]>
+#
+# Based on work by:
+# Marvell Semiconductor <www.marvell.com>
+# Written-by: Siddarth Gore <[email protected]>
+#
+# 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., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB  = $(obj)lib$(BOARD).o
+
+COBJS        := dreamplug.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))
+
+clean:
+     rm -f $(SOBJS) $(OBJS)
+
+distclean:   clean
+     rm -f $(LIB) core *.bak .depend
+
+#######################################################################

##

board/Marvell/dreamplug/Makefile new file +7 -0
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#######################################################################

##

board/Marvell/dreamplug/dreamplug.c new file +92 -0
new file mode 100644
index 0000000..cdc094a
@@ -0,0 +1,157 @@
+/*
+ * (C) Copyright 2011
+ * Jason Cooper <[email protected]>
+ *
+ * Based on work by:
+ * Marvell Semiconductor <www.marvell.com>
+ * Written-by: Siddarth Gore <[email protected]>
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#include <common.h>
+#include <miiphy.h>
+#include <asm/arch/kirkwood.h>
+#include <asm/arch/mpp.h>
+#include "dreamplug.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int board_early_init_f(void)
+{
+     /*
+      * default gpio configuration
+      * There are maximum 64 gpios controlled through 2 sets of registers
+      * the  below configuration configures mainly initial LED status
+      */
+     kw_config_gpio(DREAMPLUG_OE_VAL_LOW,
+                     DREAMPLUG_OE_VAL_HIGH,
+                     DREAMPLUG_OE_LOW, DREAMPLUG_OE_HIGH);
+
+     /* Multi-Purpose Pins Functionality configuration */
+     u32 kwmpp_config[] = {
+             MPP0_SPI_SCn,           /* SPI Flash */
+             MPP1_SPI_MOSI,
+             MPP2_SPI_SCK,
+             MPP3_SPI_MISO,
+             MPP4_NF_IO6,
+             MPP5_NF_IO7,
+             MPP6_SYSRST_OUTn,
+             MPP7_GPO,
+             MPP8_TW_SDA,
+             MPP9_TW_SCK,
+             MPP10_UART0_TXD,        /* Serial */
+             MPP11_UART0_RXD,
+             MPP12_SD_CLK,           /* SDIO Slot */
+             MPP13_SD_CMD,
+             MPP14_SD_D0,
+             MPP15_SD_D1,
+             MPP16_SD_D2,
+             MPP17_SD_D3,
+             MPP18_NF_IO0,
+             MPP19_NF_IO1,
+             MPP20_GE1_0,            /* Gigabit Ethernet */
+             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,
+             MPP37_GPIO,
+             MPP38_GPIO,
+             MPP39_GPIO,
+             MPP40_TDM_SPI_SCK,
+             MPP41_TDM_SPI_MISO,
+             MPP42_TDM_SPI_MOSI,
+             MPP43_GPIO,
Quoted 8 lines

board/Marvell/dreamplug/dreamplug.c line 97

Quoted 5 lines
board/Marvell/dreamplug/dreamplug.c new file +5 -0
+             MPP44_GPIO,
+             MPP45_GPIO,
+             MPP46_GPIO,             /* Wifi AP LED */
+             MPP47_GPIO,
+             MPP48_GPIO,             /* Wifi LED */

It is better if you can comment about rest other GPIOSs with their assigned functionality.

I filled in what I was comfortable labeling, anything else would be a guess on my part. This is a standard kirkwood configuration except for pins 0-3 and the LEDS (46,48). Should I add a comment to the same effect?

Quoted 9 lines
Quoted 9 lines
board/Marvell/dreamplug/dreamplug.c new file +9 -0
+             MPP49_GPIO,
+             0
+     };
+     kirkwood_mpp_conf(kwmpp_config);
+     return 0;
+}
+
+int board_init(void)
+{
Quoted 8 lines

board/Marvell/dreamplug/dreamplug.c line 111

Quoted 5 lines
board/Marvell/dreamplug/dreamplug.c new file +5 -0
+     /*
+      * arch number of board
+      * XXX: change to MACH_TYPE_DREAMPLUG once in Linux mainline.
+      */
+     gd->bd->bi_arch_number = MACH_TYPE_GURUPLUG;

I think this board should have some delta to guruplug? I think you should have different machine ID here.

See added changelog and patch 5 in the series.

Quoted 1 line

BTW: what is delta w.r.to guruplug?

Just 2MB SPI flash instead of 512MB NAND flash. It grabs the kernel/initrd from an internal microSD card attached via USB, instead of NAND flash. OS is on the same microSD card.

The dreamplug kernel shipped with the device doesn't even see the SPI flash. I think it may be the exact same as the guruplug kernel, although I haven't done a rigorous check. It's built for MACH_TYPE_GURUPLUG, though.

It has some bells and whistles, like audio in/out, SPDIF out. Nothing else really relevant to u-boot.

Quoted 31 lines
Quoted 31 lines
board/Marvell/dreamplug/dreamplug.c new file +31 -0
+
+     /* adress of boot parameters */
+     gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;
+
+     return 0;
+}
+
+#ifdef CONFIG_RESET_PHY_R
+void mv_phy_88e1121_init(char *name)
+{
+     u16 reg;
+     u16 devadr;
+
+     if (miiphy_set_current_dev(name))
+             return;
+
+     /* command to read PHY dev address */
+     if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) {
+             printf("Err..%s could not read PHY dev address\n",
+                     __FUNCTION__);
+             return;
+     }
+
+     /*
+      * Enable RGMII delay on Tx and Rx for CPU port
+      * Ref: sec 4.7.2 of chip datasheet
+      */
+     miiphy_write(name, devadr, MV88E1121_PGADR_REG, 2);
+     miiphy_read(name, devadr, MV88E1121_MAC_CTRL2_REG, &reg);
+     reg |= (MV88E1121_RGMII_RXTM_CTRL | MV88E1121_RGMII_TXTM_CTRL);
+     miiphy_write(name, devadr, MV88E1121_MAC_CTRL2_REG, reg);
Quoted 8 lines

board/Marvell/dreamplug/dreamplug.c line 148

Quoted 6 lines
board/Marvell/dreamplug/dreamplug.c new file +6 -0
+     miiphy_write(name, devadr, MV88E1121_PGADR_REG, 0);
+
+     /* reset the phy */
+     miiphy_reset(name, devadr);
+
+     printf("88E1116 Initialized on %s\n", name);

Function name and print info are mismatching.

Gah! good catch. I just copied that printf over from the GST source code. I'll fix it up.

Quoted 54 lines
Quoted 54 lines
board/Marvell/dreamplug/dreamplug.c new file +9 -0
+}
+
+void reset_phy(void)
+{
+     /* configure and initialize both PHY's */
+     mv_phy_88e1121_init("egiga0");
+     mv_phy_88e1121_init("egiga1");
+}
+#endif /* CONFIG_RESET_PHY_R */
board/Marvell/dreamplug/dreamplug.h new file +38 -0
new file mode 100644
index 0000000..21bf644
@@ -0,0 +1,42 @@
+/*
+ * (C) Copyright 2011
+ * Jason Cooper <[email protected]>
+ *
+ * Based on work by:
+ * Marvell Semiconductor <www.marvell.com>
+ * Written-by: Siddarth Gore <[email protected]>
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#ifndef __DREAMPLUG_H
+#define __DREAMPLUG_H
+
+#define DREAMPLUG_OE_LOW     (~(0))
+#define DREAMPLUG_OE_HIGH    (~(0))
+#define DREAMPLUG_OE_VAL_LOW 0
+#define DREAMPLUG_OE_VAL_HIGH        (0xf << 16) /* 4 LED Pins high */
+
+/* PHY related */
+#define MV88E1121_MAC_CTRL2_REG              21
+#define MV88E1121_PGADR_REG          22
Quoted 8 lines

board/Marvell/dreamplug/kwbimage.cfg

Quoted 6 lines
board/Marvell/dreamplug/dreamplug.h new file +4 -0
+#define MV88E1121_RGMII_TXTM_CTRL    (1 << 4)
+#define MV88E1121_RGMII_RXTM_CTRL    (1 << 5)
+
+#endif /* __DREAMPLUG_H */
board/Marvell/dreamplug/kwbimage.cfg +0 -0

I hope this is not same as guruplug (since you are using same machine-id)?

Very similar, see above.

thx,

Jason.

#46 lore raw

[U-Boot] RFC [PATCH 4/5 v5] dreamplug: initial board support.

Quoted 68 lines

-----Original Message-----
From: Jason [mailto:u-boot at lakedaemon.net]
Sent: Thursday, July 28, 2011 7:33 AM
To: Prafulla Wadaskar
Cc: clint at debian.org; wd at denx.de; u-boot at lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale at gag.com
Subject: Re: RFC [PATCH 4/5 v5] dreamplug: initial board support.

Quoted 7 lines · Prafulla Wadaskar
Quoted 7 lines

-----Original Message-----
From: Jason Cooper [mailto:u-boot at lakedaemon.net]
Sent: Wednesday, July 27, 2011 2:49 AM
To: clint at debian.org; wd at denx.de; Prafulla Wadaskar
Cc: u-boot at lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare;

Siddarth

Quoted 4 lines
Quoted 4 lines

Gore; bdale at gag.com; Jason Cooper
Subject: RFC [PATCH 4/5 v5] dreamplug: initial board support.

Copied wholeheartedly from board/Marvell/guruplug and modified to

add

Quoted 8 lines
Quoted 8 lines

support
for SPI NOR flash.

Also, the following features are used:
- Use the Marvell Integrated RTC.
- display Marvell CPU/L2/etc speeds if requested.

Note: this still uses MACH_TYPE_GURUPLUG until MACH_TYPE_DREAMPLUG

is

Quoted 9 lines
Quoted 5 lines

accepted
into mainline Linux. The source from Globalscale did the same.

---

There is no change log for all previous versions.
Please put them here.
Ref: http://www.denx.de/wiki/view/U-

Boot/Patches#Sending_updated_patch_versions

%$#%@#. I knew I forgot something. Here it is:

Changes from v1 to v2:

- resorted series to move 'make all' support last.

Changes from v2 to v3:

- Use MACH_TYPE_GURUPLUG for now until dreamplug support is in Linux.
- Update MAINTAINERS.
- Collapse into one patch.

Changes from v3 to v4:

- update copyright info as recommended by Prafulla Wadaskar.
- maintain proper order in boards.cfg, MAINTAINERS, etc.
- label MPP's
- change back to MACH_TYPE_DREAMPLUG. This patch is just RFC until the Dreamplug is supported in Linux (and MACH_TYPE_
added).

Changes from v4 to v5:

Quoted 16 lines

- Complete rewrite due to receiving u-boot source indirectly from Global Scale Tech.
- Added driver for integrated RTC. (thx GST!)
- Added support for displaying CPU frequencies at boot. (thx GST!)
- Adjust USB timeout to handle dreamplug EHCI chipset.
- Cleaned up MPP registers based on Global Scale code. (thx GST!)
- broke out MACH_TYPE_DREAMPLUG changes since it's going to be a while until the Linux arm tree gets sorted and accepts new boards again. Since all Dreamplugs currently on the market set r1 to MACH_TYPE_GURUPLUG, this allows the board to be added to u-boot while waiting for Linux mainline. Once it's in Linux mainline, then the last patch can be integrated to
use
MACH_TYPE_DREAMPLUG.

Please kindly repost with changelog.

Quoted 220 lines
Quoted 64 lines
Quoted 64 lines
 MAINTAINERS                          |    4 +
 MAKEALL                              |    1 +
 board/Marvell/dreamplug/Makefile     |   54 +++++++++++
 board/Marvell/dreamplug/dreamplug.c  |  157
++++++++++++++++++++++++++++++++
 board/Marvell/dreamplug/dreamplug.h  |   42 +++++++++
 board/Marvell/dreamplug/kwbimage.cfg |  163
++++++++++++++++++++++++++++++++++
 boards.cfg                           |    1 +
 include/configs/dreamplug.h          |  138
++++++++++++++++++++++++++++
 8 files changed, 560 insertions(+), 0 deletions(-)
 create mode 100644 board/Marvell/dreamplug/Makefile
 create mode 100644 board/Marvell/dreamplug/dreamplug.c
 create mode 100644 board/Marvell/dreamplug/dreamplug.h
 create mode 100644 board/Marvell/dreamplug/kwbimage.cfg
 create mode 100644 include/configs/dreamplug.h
MAINTAINERS +4 -0
index 2bba7b4..9affbea 100644
@@ -70,6 +70,10 @@ Conn Clark <[email protected]>
 
      ESTEEM192E      MPC8xx
 
+Jason Cooper <[email protected]>
+
+     dreamplug       ARM926EJS (Kirkwood SoC)
+
 Joe D'Abbraccio <[email protected]>
 
      MPC837xERDB     MPC837x
MAKEALL +1 -0
index 51db13e..55a122f 100755
@@ -335,6 +335,7 @@ LIST_ARM9="                       \
      cp966                   \
      da830evm                \
      da850evm                \
+     dreamplug               \
      edb9301                 \
      edb9302                 \
      edb9302a                \
board/Marvell/dreamplug/Makefile new file +11 -0
new file mode 100644
index 0000000..9ee5406
@@ -0,0 +1,54 @@
+#
+# (C) Copyright 2011
+# Jason Cooper <[email protected]>
+#
+# Based on work by:
+# Marvell Semiconductor <www.marvell.com>
+# Written-by: Siddarth Gore <[email protected]>
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
Quoted 8 lines

board/Marvell/dreamplug/Makefile

Quoted 8 lines
board/Marvell/dreamplug/Makefile new file +8 -0
+# 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

Quoted 20 lines
Quoted 20 lines
board/Marvell/dreamplug/Makefile new file +20 -0
+# 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., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB  = $(obj)lib$(BOARD).o
+
+COBJS        := dreamplug.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))
Quoted 8 lines

board/Marvell/dreamplug/Makefile line 46

Quoted 8 lines
board/Marvell/dreamplug/Makefile new file +7 -0
+
+clean:
+     rm -f $(SOBJS) $(OBJS)
+
+distclean:   clean
+     rm -f $(LIB) core *.bak .depend
+

+#######################################################################

Quoted 8 lines

board/Marvell/dreamplug/Makefile line 53

Quoted 8 lines

##

board/Marvell/dreamplug/Makefile new file +6 -0
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+

+#######################################################################

Quoted 22 lines
Quoted 22 lines

##

board/Marvell/dreamplug/dreamplug.c new file +14 -0
new file mode 100644
index 0000000..cdc094a
@@ -0,0 +1,157 @@
+/*
+ * (C) Copyright 2011
+ * Jason Cooper <[email protected]>
+ *
+ * Based on work by:
+ * Marvell Semiconductor <www.marvell.com>
+ * Written-by: Siddarth Gore <[email protected]>
+ *
+ * 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
Quoted 8 lines

board/Marvell/dreamplug/dreamplug.c

Quoted 8 lines
board/Marvell/dreamplug/dreamplug.c new file +8 -0
+ * 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

Quoted 10 lines
Quoted 10 lines
board/Marvell/dreamplug/dreamplug.c new file +10 -0
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#include <common.h>
+#include <miiphy.h>
+#include <asm/arch/kirkwood.h>
+#include <asm/arch/mpp.h>
+#include "dreamplug.h"
Quoted 8 lines

board/Marvell/dreamplug/dreamplug.c

Quoted 8 lines
board/Marvell/dreamplug/dreamplug.c new file +8 -0
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int board_early_init_f(void)
+{
+     /*
+      * default gpio configuration
+      * There are maximum 64 gpios controlled through 2 sets of

registers

Quoted 1 line

board/Marvell/dreamplug/dreamplug.c line 41

Quoted 1 line
board/Marvell/dreamplug/dreamplug.c new file +1 -0
+      * the  below configuration configures mainly initial LED

status

Quoted 57 lines
Quoted 56 lines
board/Marvell/dreamplug/dreamplug.c new file +56 -0
+      */
+     kw_config_gpio(DREAMPLUG_OE_VAL_LOW,
+                     DREAMPLUG_OE_VAL_HIGH,
+                     DREAMPLUG_OE_LOW, DREAMPLUG_OE_HIGH);
+
+     /* Multi-Purpose Pins Functionality configuration */
+     u32 kwmpp_config[] = {
+             MPP0_SPI_SCn,           /* SPI Flash */
+             MPP1_SPI_MOSI,
+             MPP2_SPI_SCK,
+             MPP3_SPI_MISO,
+             MPP4_NF_IO6,
+             MPP5_NF_IO7,
+             MPP6_SYSRST_OUTn,
+             MPP7_GPO,
+             MPP8_TW_SDA,
+             MPP9_TW_SCK,
+             MPP10_UART0_TXD,        /* Serial */
+             MPP11_UART0_RXD,
+             MPP12_SD_CLK,           /* SDIO Slot */
+             MPP13_SD_CMD,
+             MPP14_SD_D0,
+             MPP15_SD_D1,
+             MPP16_SD_D2,
+             MPP17_SD_D3,
+             MPP18_NF_IO0,
+             MPP19_NF_IO1,
+             MPP20_GE1_0,            /* Gigabit Ethernet */
+             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,
+             MPP37_GPIO,
+             MPP38_GPIO,
+             MPP39_GPIO,
+             MPP40_TDM_SPI_SCK,
+             MPP41_TDM_SPI_MISO,
+             MPP42_TDM_SPI_MOSI,
+             MPP43_GPIO,
+             MPP44_GPIO,
+             MPP45_GPIO,
+             MPP46_GPIO,             /* Wifi AP LED */
+             MPP47_GPIO,
+             MPP48_GPIO,             /* Wifi LED */
Quoted 7 lines
Quoted 2 lines

It is better if you can comment about rest other GPIOSs with their assigned functionality.

I filled in what I was comfortable labeling, anything else would be a guess on my part. This is a standard kirkwood configuration except for pins 0-3 and the LEDS (46,48). Should I add a comment to the same effect?

My comment was for MPPXX_GPIOs, for rest other macros are enough to explain.

Quoted 143 lines
Quoted 10 lines
Quoted 10 lines
board/Marvell/dreamplug/dreamplug.c new file +9 -0
+             MPP49_GPIO,
+             0
+     };
+     kirkwood_mpp_conf(kwmpp_config);
+     return 0;
+}
+
+int board_init(void)
+{
Quoted 8 lines

board/Marvell/dreamplug/dreamplug.c line 111

Quoted 5 lines
board/Marvell/dreamplug/dreamplug.c new file +5 -0
+     /*
+      * arch number of board
+      * XXX: change to MACH_TYPE_DREAMPLUG once in Linux mainline.
+      */
+     gd->bd->bi_arch_number = MACH_TYPE_GURUPLUG;

I think this board should have some delta to guruplug? I think you should have different machine ID here.

See added changelog and patch 5 in the series.

Quoted 1 line

BTW: what is delta w.r.to guruplug?

Just 2MB SPI flash instead of 512MB NAND flash. It grabs the kernel/initrd from an internal microSD card attached via USB, instead of NAND flash. OS is on the same microSD card.

The dreamplug kernel shipped with the device doesn't even see the SPI flash. I think it may be the exact same as the guruplug kernel, although I haven't done a rigorous check. It's built for MACH_TYPE_GURUPLUG, though.

It has some bells and whistles, like audio in/out, SPDIF out. Nothing else really relevant to u-boot.

Quoted 22 lines
Quoted 22 lines
board/Marvell/dreamplug/dreamplug.c new file +22 -0
+
+     /* adress of boot parameters */
+     gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;
+
+     return 0;
+}
+
+#ifdef CONFIG_RESET_PHY_R
+void mv_phy_88e1121_init(char *name)
+{
+     u16 reg;
+     u16 devadr;
+
+     if (miiphy_set_current_dev(name))
+             return;
+
+     /* command to read PHY dev address */
+     if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) {
+             printf("Err..%s could not read PHY dev address\n",
+                     __FUNCTION__);
+             return;
+     }
Quoted 8 lines

board/Marvell/dreamplug/dreamplug.c

Quoted 8 lines
board/Marvell/dreamplug/dreamplug.c new file +8 -0
+
+     /*
+      * Enable RGMII delay on Tx and Rx for CPU port
+      * Ref: sec 4.7.2 of chip datasheet
+      */
+     miiphy_write(name, devadr, MV88E1121_PGADR_REG, 2);
+     miiphy_read(name, devadr, MV88E1121_MAC_CTRL2_REG, &reg);
+     reg |= (MV88E1121_RGMII_RXTM_CTRL |

MV88E1121_RGMII_TXTM_CTRL);

Quoted 9 lines

board/Marvell/dreamplug/dreamplug.c line 148

Quoted 7 lines
board/Marvell/dreamplug/dreamplug.c new file +7 -0
+     miiphy_write(name, devadr, MV88E1121_MAC_CTRL2_REG, reg);
+     miiphy_write(name, devadr, MV88E1121_PGADR_REG, 0);
+
+     /* reset the phy */
+     miiphy_reset(name, devadr);
+
+     printf("88E1116 Initialized on %s\n", name);

Function name and print info are mismatching.

Gah! good catch. I just copied that printf over from the GST source code. I'll fix it up.

Quoted 30 lines
Quoted 30 lines
board/Marvell/dreamplug/dreamplug.c new file +9 -0
+}
+
+void reset_phy(void)
+{
+     /* configure and initialize both PHY's */
+     mv_phy_88e1121_init("egiga0");
+     mv_phy_88e1121_init("egiga1");
+}
+#endif /* CONFIG_RESET_PHY_R */
board/Marvell/dreamplug/dreamplug.h new file +14 -0
new file mode 100644
index 0000000..21bf644
@@ -0,0 +1,42 @@
+/*
+ * (C) Copyright 2011
+ * Jason Cooper <[email protected]>
+ *
+ * Based on work by:
+ * Marvell Semiconductor <www.marvell.com>
+ * Written-by: Siddarth Gore <[email protected]>
+ *
+ * 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
Quoted 8 lines

board/Marvell/dreamplug/dreamplug.h line 22

Quoted 8 lines
board/Marvell/dreamplug/dreamplug.h new file +8 -0
+ * 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

Quoted 4 lines
Quoted 4 lines
board/Marvell/dreamplug/dreamplug.h new file +4 -0
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
Quoted 8 lines

board/Marvell/dreamplug/dreamplug.h

Quoted 8 lines
board/Marvell/dreamplug/dreamplug.h new file +8 -0
+
+#ifndef __DREAMPLUG_H
+#define __DREAMPLUG_H
+
+#define DREAMPLUG_OE_LOW     (~(0))
+#define DREAMPLUG_OE_HIGH    (~(0))
+#define DREAMPLUG_OE_VAL_LOW 0
+#define DREAMPLUG_OE_VAL_HIGH        (0xf << 16) /* 4 LED Pins high

*/

Quoted 4 lines
Quoted 4 lines
board/Marvell/dreamplug/dreamplug.h new file +4 -0
+
+/* PHY related */
+#define MV88E1121_MAC_CTRL2_REG              21
+#define MV88E1121_PGADR_REG          22
Quoted 8 lines

board/Marvell/dreamplug/kwbimage.cfg

Quoted 6 lines
board/Marvell/dreamplug/dreamplug.h new file +4 -0
+#define MV88E1121_RGMII_TXTM_CTRL    (1 << 4)
+#define MV88E1121_RGMII_RXTM_CTRL    (1 << 5)
+
+#endif /* __DREAMPLUG_H */
board/Marvell/dreamplug/kwbimage.cfg +0 -0

I hope this is not same as guruplug (since you are using same machine-

Quoted 3 lines

id)?

Very similar, see above.

We can overrule this at this and can go ahead having dreamplug as new board support since we have valid machin_id for this board.

Regards..
Prafulla . .

author
#47 lore raw

[U-Boot] RFC [PATCH 4/5 v5] dreamplug: initial board support.

Quoted 85 lines · Prafulla Wadaskar
Quoted 68 lines

-----Original Message-----
From: Jason [mailto:u-boot at lakedaemon.net]
Sent: Thursday, July 28, 2011 7:33 AM
To: Prafulla Wadaskar
Cc: clint at debian.org; wd at denx.de; u-boot at lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale at gag.com
Subject: Re: RFC [PATCH 4/5 v5] dreamplug: initial board support.

Quoted 7 lines · Prafulla Wadaskar
Quoted 7 lines

-----Original Message-----
From: Jason Cooper [mailto:u-boot at lakedaemon.net]
Sent: Wednesday, July 27, 2011 2:49 AM
To: clint at debian.org; wd at denx.de; Prafulla Wadaskar
Cc: u-boot at lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare;

Siddarth

Quoted 4 lines
Quoted 4 lines

Gore; bdale at gag.com; Jason Cooper
Subject: RFC [PATCH 4/5 v5] dreamplug: initial board support.

Copied wholeheartedly from board/Marvell/guruplug and modified to

add

Quoted 8 lines
Quoted 8 lines

support
for SPI NOR flash.

Also, the following features are used:
- Use the Marvell Integrated RTC.
- display Marvell CPU/L2/etc speeds if requested.

Note: this still uses MACH_TYPE_GURUPLUG until MACH_TYPE_DREAMPLUG

is

Quoted 9 lines
Quoted 5 lines

accepted
into mainline Linux. The source from Globalscale did the same.

---

There is no change log for all previous versions.
Please put them here.
Ref: http://www.denx.de/wiki/view/U-

Boot/Patches#Sending_updated_patch_versions

%$#%@#. I knew I forgot something. Here it is:

Changes from v1 to v2:

- resorted series to move 'make all' support last.

Changes from v2 to v3:

- Use MACH_TYPE_GURUPLUG for now until dreamplug support is in Linux.
- Update MAINTAINERS.
- Collapse into one patch.

Changes from v3 to v4:

- update copyright info as recommended by Prafulla Wadaskar.
- maintain proper order in boards.cfg, MAINTAINERS, etc.
- label MPP's
- change back to MACH_TYPE_DREAMPLUG. This patch is just RFC until the Dreamplug is supported in Linux (and MACH_TYPE_
added).

Changes from v4 to v5:

Quoted 16 lines

- Complete rewrite due to receiving u-boot source indirectly from Global Scale Tech.
- Added driver for integrated RTC. (thx GST!)
- Added support for displaying CPU frequencies at boot. (thx GST!)
- Adjust USB timeout to handle dreamplug EHCI chipset.
- Cleaned up MPP registers based on Global Scale code. (thx GST!)
- broke out MACH_TYPE_DREAMPLUG changes since it's going to be a while until the Linux arm tree gets sorted and accepts new boards again. Since all Dreamplugs currently on the market set r1 to MACH_TYPE_GURUPLUG, this allows the board to be added to u-boot while waiting for Linux mainline. Once it's in Linux mainline, then the last patch can be integrated to
use
MACH_TYPE_DREAMPLUG.

Quoted 1 line

Please kindly repost with changelog.

Will do.

Quoted 223 lines
Quoted 223 lines
Quoted 64 lines
Quoted 64 lines
 MAINTAINERS                          |    4 +
 MAKEALL                              |    1 +
 board/Marvell/dreamplug/Makefile     |   54 +++++++++++
 board/Marvell/dreamplug/dreamplug.c  |  157
++++++++++++++++++++++++++++++++
 board/Marvell/dreamplug/dreamplug.h  |   42 +++++++++
 board/Marvell/dreamplug/kwbimage.cfg |  163
++++++++++++++++++++++++++++++++++
 boards.cfg                           |    1 +
 include/configs/dreamplug.h          |  138
++++++++++++++++++++++++++++
 8 files changed, 560 insertions(+), 0 deletions(-)
 create mode 100644 board/Marvell/dreamplug/Makefile
 create mode 100644 board/Marvell/dreamplug/dreamplug.c
 create mode 100644 board/Marvell/dreamplug/dreamplug.h
 create mode 100644 board/Marvell/dreamplug/kwbimage.cfg
 create mode 100644 include/configs/dreamplug.h
MAINTAINERS +4 -0
index 2bba7b4..9affbea 100644
@@ -70,6 +70,10 @@ Conn Clark <[email protected]>
 
      ESTEEM192E      MPC8xx
 
+Jason Cooper <[email protected]>
+
+     dreamplug       ARM926EJS (Kirkwood SoC)
+
 Joe D'Abbraccio <[email protected]>
 
      MPC837xERDB     MPC837x
MAKEALL +1 -0
index 51db13e..55a122f 100755
@@ -335,6 +335,7 @@ LIST_ARM9="                       \
      cp966                   \
      da830evm                \
      da850evm                \
+     dreamplug               \
      edb9301                 \
      edb9302                 \
      edb9302a                \
board/Marvell/dreamplug/Makefile new file +11 -0
new file mode 100644
index 0000000..9ee5406
@@ -0,0 +1,54 @@
+#
+# (C) Copyright 2011
+# Jason Cooper <[email protected]>
+#
+# Based on work by:
+# Marvell Semiconductor <www.marvell.com>
+# Written-by: Siddarth Gore <[email protected]>
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
Quoted 8 lines

board/Marvell/dreamplug/Makefile

Quoted 8 lines
board/Marvell/dreamplug/Makefile new file +8 -0
+# 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

Quoted 20 lines
Quoted 20 lines
board/Marvell/dreamplug/Makefile new file +20 -0
+# 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., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB  = $(obj)lib$(BOARD).o
+
+COBJS        := dreamplug.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))
Quoted 8 lines

board/Marvell/dreamplug/Makefile line 46

Quoted 8 lines
board/Marvell/dreamplug/Makefile new file +7 -0
+
+clean:
+     rm -f $(SOBJS) $(OBJS)
+
+distclean:   clean
+     rm -f $(LIB) core *.bak .depend
+

+#######################################################################

Quoted 8 lines

board/Marvell/dreamplug/Makefile line 53

Quoted 8 lines

##

board/Marvell/dreamplug/Makefile new file +6 -0
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+

+#######################################################################

Quoted 22 lines
Quoted 22 lines

##

board/Marvell/dreamplug/dreamplug.c new file +14 -0
new file mode 100644
index 0000000..cdc094a
@@ -0,0 +1,157 @@
+/*
+ * (C) Copyright 2011
+ * Jason Cooper <[email protected]>
+ *
+ * Based on work by:
+ * Marvell Semiconductor <www.marvell.com>
+ * Written-by: Siddarth Gore <[email protected]>
+ *
+ * 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
Quoted 8 lines

board/Marvell/dreamplug/dreamplug.c

Quoted 8 lines
board/Marvell/dreamplug/dreamplug.c new file +8 -0
+ * 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

Quoted 10 lines
Quoted 10 lines
board/Marvell/dreamplug/dreamplug.c new file +10 -0
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#include <common.h>
+#include <miiphy.h>
+#include <asm/arch/kirkwood.h>
+#include <asm/arch/mpp.h>
+#include "dreamplug.h"
Quoted 8 lines

board/Marvell/dreamplug/dreamplug.c

Quoted 8 lines
board/Marvell/dreamplug/dreamplug.c new file +8 -0
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int board_early_init_f(void)
+{
+     /*
+      * default gpio configuration
+      * There are maximum 64 gpios controlled through 2 sets of

registers

Quoted 1 line

board/Marvell/dreamplug/dreamplug.c line 41

Quoted 1 line
board/Marvell/dreamplug/dreamplug.c new file +1 -0
+      * the  below configuration configures mainly initial LED

status

Quoted 59 lines
Quoted 46 lines
board/Marvell/dreamplug/dreamplug.c new file +46 -0
+      */
+     kw_config_gpio(DREAMPLUG_OE_VAL_LOW,
+                     DREAMPLUG_OE_VAL_HIGH,
+                     DREAMPLUG_OE_LOW, DREAMPLUG_OE_HIGH);
+
+     /* Multi-Purpose Pins Functionality configuration */
+     u32 kwmpp_config[] = {
+             MPP0_SPI_SCn,           /* SPI Flash */
+             MPP1_SPI_MOSI,
+             MPP2_SPI_SCK,
+             MPP3_SPI_MISO,
+             MPP4_NF_IO6,
+             MPP5_NF_IO7,
+             MPP6_SYSRST_OUTn,
+             MPP7_GPO,
+             MPP8_TW_SDA,
+             MPP9_TW_SCK,
+             MPP10_UART0_TXD,        /* Serial */
+             MPP11_UART0_RXD,
+             MPP12_SD_CLK,           /* SDIO Slot */
+             MPP13_SD_CMD,
+             MPP14_SD_D0,
+             MPP15_SD_D1,
+             MPP16_SD_D2,
+             MPP17_SD_D3,
+             MPP18_NF_IO0,
+             MPP19_NF_IO1,
+             MPP20_GE1_0,            /* Gigabit Ethernet */
+             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,
+             MPP37_GPIO,
+             MPP38_GPIO,

board/Marvell/dreamplug/dreamplug.c line 97

Quoted 10 lines
board/Marvell/dreamplug/dreamplug.c new file +10 -0
+             MPP39_GPIO,
+             MPP40_TDM_SPI_SCK,
+             MPP41_TDM_SPI_MISO,
+             MPP42_TDM_SPI_MOSI,
+             MPP43_GPIO,
+             MPP44_GPIO,
+             MPP45_GPIO,
+             MPP46_GPIO,             /* Wifi AP LED */
+             MPP47_GPIO,
+             MPP48_GPIO,             /* Wifi LED */

It is better if you can comment about rest other GPIOSs with their assigned functionality.

Quoted 6 lines
Quoted 4 lines

I filled in what I was comfortable labeling, anything else would be a guess on my part. This is a standard kirkwood configuration except for pins 0-3 and the LEDS (46,48). Should I add a comment to the same effect?

My comment was for MPPXX_GPIOs, for rest other macros are enough to explain.

Ahh, The Sheevaplug and the Guruplug had 7 GPIO pins exported to a header on the pcb. I haven't taken apart the dreamplug, but would assume it's the same. Especially since the Global Scale code didn't change it.

MPP47 and MPP49 were LED pins on previous *plugs and appear not to be used in the dreamplug.

I'll locate the header on the pcb and make a comment in the next version. If they are broken out, it would be nice to use the (proposed) gpio cmd on them from within uboot.

Quoted 142 lines
Quoted 142 lines
Quoted 9 lines
Quoted 9 lines
board/Marvell/dreamplug/dreamplug.c new file +9 -0
+             MPP49_GPIO,
+             0
+     };
+     kirkwood_mpp_conf(kwmpp_config);
+     return 0;
+}
+
+int board_init(void)
+{
Quoted 8 lines

board/Marvell/dreamplug/dreamplug.c line 111

Quoted 5 lines
board/Marvell/dreamplug/dreamplug.c new file +5 -0
+     /*
+      * arch number of board
+      * XXX: change to MACH_TYPE_DREAMPLUG once in Linux mainline.
+      */
+     gd->bd->bi_arch_number = MACH_TYPE_GURUPLUG;

I think this board should have some delta to guruplug? I think you should have different machine ID here.

See added changelog and patch 5 in the series.

Quoted 1 line

BTW: what is delta w.r.to guruplug?

Just 2MB SPI flash instead of 512MB NAND flash. It grabs the kernel/initrd from an internal microSD card attached via USB, instead of NAND flash. OS is on the same microSD card.

The dreamplug kernel shipped with the device doesn't even see the SPI flash. I think it may be the exact same as the guruplug kernel, although I haven't done a rigorous check. It's built for MACH_TYPE_GURUPLUG, though.

It has some bells and whistles, like audio in/out, SPDIF out. Nothing else really relevant to u-boot.

Quoted 22 lines
Quoted 22 lines
board/Marvell/dreamplug/dreamplug.c new file +22 -0
+
+     /* adress of boot parameters */
+     gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;
+
+     return 0;
+}
+
+#ifdef CONFIG_RESET_PHY_R
+void mv_phy_88e1121_init(char *name)
+{
+     u16 reg;
+     u16 devadr;
+
+     if (miiphy_set_current_dev(name))
+             return;
+
+     /* command to read PHY dev address */
+     if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) {
+             printf("Err..%s could not read PHY dev address\n",
+                     __FUNCTION__);
+             return;
+     }
Quoted 8 lines

board/Marvell/dreamplug/dreamplug.c

Quoted 8 lines
board/Marvell/dreamplug/dreamplug.c new file +8 -0
+
+     /*
+      * Enable RGMII delay on Tx and Rx for CPU port
+      * Ref: sec 4.7.2 of chip datasheet
+      */
+     miiphy_write(name, devadr, MV88E1121_PGADR_REG, 2);
+     miiphy_read(name, devadr, MV88E1121_MAC_CTRL2_REG, &reg);
+     reg |= (MV88E1121_RGMII_RXTM_CTRL |

MV88E1121_RGMII_TXTM_CTRL);

Quoted 9 lines

board/Marvell/dreamplug/dreamplug.c line 148

Quoted 7 lines
board/Marvell/dreamplug/dreamplug.c new file +7 -0
+     miiphy_write(name, devadr, MV88E1121_MAC_CTRL2_REG, reg);
+     miiphy_write(name, devadr, MV88E1121_PGADR_REG, 0);
+
+     /* reset the phy */
+     miiphy_reset(name, devadr);
+
+     printf("88E1116 Initialized on %s\n", name);

Function name and print info are mismatching.

Gah! good catch. I just copied that printf over from the GST source code. I'll fix it up.

Quoted 30 lines
Quoted 30 lines
board/Marvell/dreamplug/dreamplug.c new file +9 -0
+}
+
+void reset_phy(void)
+{
+     /* configure and initialize both PHY's */
+     mv_phy_88e1121_init("egiga0");
+     mv_phy_88e1121_init("egiga1");
+}
+#endif /* CONFIG_RESET_PHY_R */
board/Marvell/dreamplug/dreamplug.h new file +14 -0
new file mode 100644
index 0000000..21bf644
@@ -0,0 +1,42 @@
+/*
+ * (C) Copyright 2011
+ * Jason Cooper <[email protected]>
+ *
+ * Based on work by:
+ * Marvell Semiconductor <www.marvell.com>
+ * Written-by: Siddarth Gore <[email protected]>
+ *
+ * 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
Quoted 8 lines

board/Marvell/dreamplug/dreamplug.h line 22

Quoted 8 lines
board/Marvell/dreamplug/dreamplug.h new file +8 -0
+ * 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

Quoted 4 lines
Quoted 4 lines
board/Marvell/dreamplug/dreamplug.h new file +4 -0
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
Quoted 8 lines

board/Marvell/dreamplug/dreamplug.h

Quoted 8 lines
board/Marvell/dreamplug/dreamplug.h new file +8 -0
+
+#ifndef __DREAMPLUG_H
+#define __DREAMPLUG_H
+
+#define DREAMPLUG_OE_LOW     (~(0))
+#define DREAMPLUG_OE_HIGH    (~(0))
+#define DREAMPLUG_OE_VAL_LOW 0
+#define DREAMPLUG_OE_VAL_HIGH        (0xf << 16) /* 4 LED Pins high

*/

Quoted 12 lines

board/Marvell/dreamplug/kwbimage.cfg

Quoted 10 lines
board/Marvell/dreamplug/dreamplug.h new file +8 -0
+
+/* PHY related */
+#define MV88E1121_MAC_CTRL2_REG              21
+#define MV88E1121_PGADR_REG          22
+#define MV88E1121_RGMII_TXTM_CTRL    (1 << 4)
+#define MV88E1121_RGMII_RXTM_CTRL    (1 << 5)
+
+#endif /* __DREAMPLUG_H */
board/Marvell/dreamplug/kwbimage.cfg +0 -0

I hope this is not same as guruplug (since you are using same machine-

Quoted 6 lines
Quoted 3 lines

id)?

Very similar, see above.

We can overrule this at this and can go ahead having dreamplug as new board support since we have valid machin_id for this board.

Okay, I'll go dig up the patch for changing mach-types.h and include it in the next revision.

thx,

Jason.

#48 lore raw

[U-Boot] RFC [PATCH 4/5 v5] dreamplug: initial board support.

Quoted 10 lines

-----Original Message-----
From: Jason [mailto:u-boot at lakedaemon.net]
Sent: Friday, July 29, 2011 8:49 PM
To: Prafulla Wadaskar
Cc: clint at debian.org; wd at denx.de; u-boot at lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale at gag.com
Subject: Re: RFC [PATCH 4/5 v5] dreamplug: initial board support.

...snip...

Quoted 15 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
board/Marvell/dreamplug/dreamplug.h new file +4 -0
+
+/* PHY related */
+#define MV88E1121_MAC_CTRL2_REG              21
+#define MV88E1121_PGADR_REG          22
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

board/Marvell/dreamplug/kwbimage.cfg

Quoted 6 lines
board/Marvell/dreamplug/dreamplug.h new file +4 -0
+#define MV88E1121_RGMII_TXTM_CTRL    (1 << 4)
+#define MV88E1121_RGMII_RXTM_CTRL    (1 << 5)
+
+#endif /* __DREAMPLUG_H */
board/Marvell/dreamplug/kwbimage.cfg +0 -0

I hope this is not same as guruplug (since you are using same

machine-

Quoted 2 lines
Quoted 2 lines

id)?

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Very similar, see above.

We can overrule this at this and can go ahead having dreamplug as new board support since we have valid machin_id for this board.

Okay, I'll go dig up the patch for changing mach-types.h and include it in the next revision.

As you said in other email, dreaplug used guruplug machine ID, this is wrong in principle.

Changing machin-types.h is strictly not recommended, it will be NACked. So you have two options.
1. go and register new machin-id for dreamplug (if h/w delta is considerably high)
2. don't add dreamplug as separate board support, add it as new version for guruplug.

Regards..
Prafulla . .

author
#49 lore raw

[U-Boot] RFC [PATCH 4/5 v5] dreamplug: initial board support.

Quoted 31 lines · Prafulla Wadaskar
Quoted 10 lines

-----Original Message-----
From: Jason [mailto:u-boot at lakedaemon.net]
Sent: Friday, July 29, 2011 8:49 PM
To: Prafulla Wadaskar
Cc: clint at debian.org; wd at denx.de; u-boot at lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale at gag.com
Subject: Re: RFC [PATCH 4/5 v5] dreamplug: initial board support.

...snip...

Quoted 20 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
board/Marvell/dreamplug/dreamplug.h new file +4 -0
+
+/* PHY related */
+#define MV88E1121_MAC_CTRL2_REG              21
+#define MV88E1121_PGADR_REG          22
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

board/Marvell/dreamplug/kwbimage.cfg

Quoted 6 lines
board/Marvell/dreamplug/dreamplug.h new file +4 -0
+#define MV88E1121_RGMII_TXTM_CTRL    (1 << 4)
+#define MV88E1121_RGMII_RXTM_CTRL    (1 << 5)
+
+#endif /* __DREAMPLUG_H */
board/Marvell/dreamplug/kwbimage.cfg +0 -0

I hope this is not same as guruplug (since you are using same

machine-

Quoted 6 lines
Quoted 3 lines

id)?

Very similar, see above.

We can overrule this at this and can go ahead having dreamplug as new board support since we have valid machin_id for this board.

Quoted 8 lines
Quoted 2 lines

Okay, I'll go dig up the patch for changing mach-types.h and include it in the next revision.

As you said in other email, dreaplug used guruplug machine ID, this is wrong in principle.

Changing machin-types.h is strictly not recommended, it will be NACked.

Right, this was my understanding. I must've misunderstood you.

Quoted 3 lines

So you have two options.
1. go and register new machin-id for dreamplug (if h/w delta is considerably high)

Already did that a while ago. [1] The problem is, Linux controls mach-types.h and linux-arm isn't accepting new boards until they sort themselves out. Hence, why I was trying to establish a migration path.

The Dreamplug *can* use a MACH_TYPE_GURUPLUG kernel (that's what it ships with), but Linux and userspace can't see the SPI flash in this configuration. In order to update uboot or to change uboot config userspace (eg debian) *must* be able to access the SPI flash. That's why I think the new machid is necessary.

Distributions can carry the patches until mainline gets things sorted, so I'm not worried about that (other than the USB bug). I'm concerned about the folks who want to build a newer / custom uboot and put it on an existing system. They will most likely be using the kernel shipped with the Dreamplug, which is MACH_TYPE_GURUPLUG. Merging patches 1/5, 2/5, and 4/5 once in proper form, will allow users to do this.

If the same user wants to access SPI flash from userspace, they can built a kernel.org kernel with my patches [2], and build uboot with patch 5/5 in my series to switch over to MACH_TYPE_DREAMPLUG.

I know it's complicated, thanks for bearing with me. I haven't been able to find any recommendations by the linux-arm folks as far as what devs with new boards should be doing. I did just find [3] where Arnd Bergmann pushed a couple new boards upstream. I'll do some more research...

thx,

Jason.

[1] http://www.arm.linux.org.uk/developer/machines/list.php?id=3550

*** Old version of patch! ***
[2] https://patchwork.kernel.org/patch/879982/
[3] http://lkml.org/lkml/2011/7/26/430

#50 lore raw

[U-Boot] RFC [PATCH 4/5 v5] dreamplug: initial board support.

In reply to Jason Cooper

Dear Jason Cooper,

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

Copied wholeheartedly from board/Marvell/guruplug and modified to add support for SPI NOR flash.

...

board/Marvell/dreamplug/dreamplug.c line 131

Quoted 4 lines
board/Marvell/dreamplug/dreamplug.c new file +4 -0
+	/* command to read PHY dev address */
+	if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) {
+		printf("Err..%s could not read PHY dev address\n",
+			__FUNCTION__);

Checkpatch says:

WARNING: __func__ should be used instead of gcc specific __FUNCTION__

Best regards,

Wolfgang Denk

Signature · 4 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
Your own mileage may vary.
author
#51 lore raw

[U-Boot] RFC [PATCH 4/5 v5] dreamplug: initial board support.

Wolfgang,

Quoted 4 lines · Wolfgang Denk
Quoted 2 lines · In message <[email protected]> you wrote:

Copied wholeheartedly from board/Marvell/guruplug and modified to add support for SPI NOR flash.

...

Quoted 8 lines

board/Marvell/dreamplug/dreamplug.c line 131

Quoted 4 lines
board/Marvell/dreamplug/dreamplug.c new file +4 -0
+	/* command to read PHY dev address */
+	if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) {
+		printf("Err..%s could not read PHY dev address\n",
+			__FUNCTION__);

Checkpatch says:

WARNING: __func__ should be used instead of gcc specific __FUNCTION__

This is an old version of this patch. v8 is currently in Prafulla's u-boot-marvell git tree. It's fixed in there.

thx,

Jason.

#52 lore raw

[U-Boot] RFC [PATCH 5/5 v5] dreamplug: use MACH_TYPE_DREAMPLUG

In reply to u-boot at lakedaemon.net
---
 board/Marvell/dreamplug/dreamplug.c |    7 ++-----
 include/configs/dreamplug.h         |    2 +-
 2 files changed, 3 insertions(+), 6 deletions(-)
board/Marvell/dreamplug/dreamplug.c +2 -5
index cdc094a..f848db7 100644
@@ -104,11 +104,8 @@ int board_early_init_f(void)
 
 int board_init(void)
 {
-	/*
-	 * arch number of board
-	 * XXX: change to MACH_TYPE_DREAMPLUG once in Linux mainline.
-	 */
-	gd->bd->bi_arch_number = MACH_TYPE_GURUPLUG;
+	/* arch number of board */
+	gd->bd->bi_arch_number = MACH_TYPE_DREAMPLUG;
 
 	/* adress of boot parameters */
 	gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;
include/configs/dreamplug.h +1 -1
index 2a908f4..4be2e59 100644
@@ -39,7 +39,7 @@
 #define CONFIG_SHEEVA_88SV131	1	/* CPU Core subversion */
 #define CONFIG_KIRKWOOD		1	/* SOC Family Name */
 #define CONFIG_KW88F6281	1	/* SOC Name */
-#define CONFIG_MACH_GURUPLUG	/* Machine type */
+#define CONFIG_MACH_DREAMPLUG	/* Machine type */
 #define CONFIG_SKIP_LOWLEVEL_INIT	/* disable board lowlevel_init */
 
 /*
Signature · 1 line
1.7.0.4
#53 lore raw

[U-Boot] RFC [PATCH 5/5 v5] dreamplug: use MACH_TYPE_DREAMPLUG

Quoted 9 lines

-----Original Message-----
From: Jason Cooper [mailto:u-boot at lakedaemon.net]
Sent: Wednesday, July 27, 2011 2:49 AM
To: clint at debian.org; wd at denx.de; Prafulla Wadaskar
Cc: u-boot at lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale at gag.com; Jason Cooper
Subject: RFC [PATCH 5/5 v5] dreamplug: use MACH_TYPE_DREAMPLUG

Sorry about my related comments in patch 4/5, you can merge this patch to 4/5 to avoid confusion.

Regards..
Prafulla . .

author
#54 lore raw

[U-Boot] RFC [PATCH 5/5 v5] dreamplug: use MACH_TYPE_DREAMPLUG

Quoted 10 lines · Prafulla Wadaskar
Quoted 7 lines

-----Original Message-----
From: Jason Cooper [mailto:u-boot at lakedaemon.net]
Sent: Wednesday, July 27, 2011 2:49 AM
To: clint at debian.org; wd at denx.de; Prafulla Wadaskar
Cc: u-boot at lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale at gag.com; Jason Cooper
Subject: RFC [PATCH 5/5 v5] dreamplug: use MACH_TYPE_DREAMPLUG

Sorry about my related comments in patch 4/5, you can merge this patch to 4/5 to avoid confusion.

See my comments in my reply to 4/5. I'd like (if possible) to get this merged before h*ll freezes over (Linux arm tree cleaned up). So, I'm trying to break the patch up into logical migration pieces.

Since every Dreamplug on the market sets and uses MACH_TYPE_GURUPLUG, I think it's reasonable to use it (hopefully merged into u-boot) until the linux-arm tree gets sorted out and they accept new boards / machids. Then, the last patch can be added.

Am I way off base with that idea?

thx,

Jason.

author
#56 lore raw

[U-Boot] RFC [PATCH 5/5 v5] dreamplug: use MACH_TYPE_DREAMPLUG

Quoted 11 lines · Bdale Garbee
Quoted 4 lines · Jason

Since every Dreamplug on the market sets and uses MACH_TYPE_GURUPLUG, I think it's reasonable to use it (hopefully merged into u-boot) until the linux-arm tree gets sorted out and they accept new boards / machids. Then, the last patch can be added.

If we're going to re-flash a bunch of Dreamplug units with new u-boot, I'd prefer we go ahead and set a new id. If that means we have to carry around a local kernel patch for a while until the new id gets merged into the kernel.org tree, that seems much easier to cope with than having to flash yet another new u-boot later?

I agree, which is why I included patch 5. I've rebased my Linux dreamplug patches against v3.0 and am doing some testing, Hopefully I can push those out this weekend. I'll add you folks to the CC when I do that.

Do you think Linus, GregKH and others would flip if I suggested arch/arm/staging/* ? ;-)

thx,

Jason.

#57 lore raw

[U-Boot] RFC [PATCH 5/5 v5] dreamplug: use MACH_TYPE_DREAMPLUG

Quoted 4 lines · Jason

I agree, which is why I included patch 5. I've rebased my Linux dreamplug patches against v3.0 and am doing some testing, Hopefully I can push those out this weekend. I'll add you folks to the CC when I do that.

Great, I'll look forward to them. We're getting dangerously close to having all the right bits in hand to issue an initial developer's image for the Dreamplug on behalf of the FreedomBox Foundation. Really appreciate your timely help with this part!

Quoted 2 lines

Do you think Linus, GregKH and others would flip if I suggested arch/arm/staging/* ? ;-)

;-)

Bdale
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110728/98264f15/attachment.pgp

#58 lore raw

[U-Boot] RFC [PATCH 5/5 v5] dreamplug: use MACH_TYPE_DREAMPLUG

In reply to Jason
Quoted 27 lines

-----Original Message-----
From: Jason [mailto:u-boot at lakedaemon.net]
Sent: Thursday, July 28, 2011 7:38 AM
To: Prafulla Wadaskar
Cc: clint at debian.org; wd at denx.de; u-boot at lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale at gag.com
Subject: Re: RFC [PATCH 5/5 v5] dreamplug: use MACH_TYPE_DREAMPLUG

Quoted 5 lines · Prafulla Wadaskar
Quoted 5 lines

-----Original Message-----
From: Jason Cooper [mailto:u-boot at lakedaemon.net]
Sent: Wednesday, July 27, 2011 2:49 AM
To: clint at debian.org; wd at denx.de; Prafulla Wadaskar
Cc: u-boot at lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare;

Siddarth

Quoted 5 lines
Quoted 2 lines

Gore; bdale at gag.com; Jason Cooper
Subject: RFC [PATCH 5/5 v5] dreamplug: use MACH_TYPE_DREAMPLUG

Sorry about my related comments in patch 4/5, you can merge this patch to 4/5 to avoid confusion.

See my comments in my reply to 4/5. I'd like (if possible) to get this merged before h*ll freezes over (Linux arm tree cleaned up). So, I'm trying to break the patch up into logical migration pieces.

Quoted 6 lines

Since every Dreamplug on the market sets and uses MACH_TYPE_GURUPLUG, I think it's reasonable to use it (hopefully merged into u-boot) until the linux-arm tree gets sorted out and they accept new boards / machids. Then, the last patch can be added.

Am I way off base with that idea?

So this is gating to provide dreamplug as separate board support or anther version for guruplug.

Regards..
Prafulla . .

author
#59 lore raw

[U-Boot] RFC [PATCH 5/5 v5] dreamplug: use MACH_TYPE_DREAMPLUG

Quoted 32 lines · Prafulla Wadaskar
Quoted 32 lines

-----Original Message-----
From: Jason [mailto:u-boot at lakedaemon.net]
Sent: Thursday, July 28, 2011 7:38 AM
To: Prafulla Wadaskar
Cc: clint at debian.org; wd at denx.de; u-boot at lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale at gag.com
Subject: Re: RFC [PATCH 5/5 v5] dreamplug: use MACH_TYPE_DREAMPLUG

Quoted 5 lines · Prafulla Wadaskar
Quoted 5 lines

-----Original Message-----
From: Jason Cooper [mailto:u-boot at lakedaemon.net]
Sent: Wednesday, July 27, 2011 2:49 AM
To: clint at debian.org; wd at denx.de; Prafulla Wadaskar
Cc: u-boot at lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare;

Siddarth

Quoted 5 lines
Quoted 2 lines

Gore; bdale at gag.com; Jason Cooper
Subject: RFC [PATCH 5/5 v5] dreamplug: use MACH_TYPE_DREAMPLUG

Sorry about my related comments in patch 4/5, you can merge this patch to 4/5 to avoid confusion.

See my comments in my reply to 4/5. I'd like (if possible) to get this merged before h*ll freezes over (Linux arm tree cleaned up). So, I'm trying to break the patch up into logical migration pieces.

Since every Dreamplug on the market sets and uses MACH_TYPE_GURUPLUG, I think it's reasonable to use it (hopefully merged into u-boot) until the linux-arm tree gets sorted out and they accept new boards / machids. Then, the last patch can be added.

Quoted 4 lines
Quoted 1 line

Am I way off base with that idea?

So this is gating to provide dreamplug as separate board support or anther version for guruplug.

Separate board support. I'm trying to work around the fact that GlobalScale _didn't_ request / use a separate machid when they should have. They just reused MACH_TYPE_GURUPLUG. :-(

thx,

Jason.