Skip to contentSkip to conversation

Support for LinkStation / KuroBox HD and HG PPC models

PATCH Superseded Guennadi Liakhovetski 2 participants 9 messages Mar 30, 2008 – Apr 28, 2008

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 Support for LinkStation / KuroBox HD and HG PPC models

This patch is based on the port by Mihai Georgian (see linkstation.c for Copyright information) and implements support for LinkStation / KuroBox HD and HG PPC models from Buffalo Technology, whereby HD is deactivated at the moment, pending network driver fixing.

Notice to users: this is pretty much a barebone port. Support for network on HG models is already in the U-Boot mainline, but you might also want patches to switch fan / phy modes depending on the negotiated ethernet parameters. This patch also doesn't support console switching, booting EM mode, Buffalo specific ext2 magic number. So, if you want to use any of those, you need additional patches. Otherwise this patche provides a fully functional u-boot with a network console on your system.

---

As the comment in the Makefile states, HD is disabled at the moment due to a problem with the network driver, which has to be investigated further, as hardware availability and time permit.

 MAKEALL                         |    1 +
 Makefile                        |   12 ++
 board/linkstation/Makefile      |   40 +++
 board/linkstation/avr.c         |  293 ++++++++++++++++++++++
 board/linkstation/config.mk     |   50 ++++
 board/linkstation/hwctl.c       |  135 +++++++++++
 board/linkstation/ide.c         |   99 ++++++++
 board/linkstation/linkstation.c |  130 ++++++++++
 include/configs/linkstation.h   |  509 +++++++++++++++++++++++++++++++++++++++
 9 files changed, 1267 insertions(+), 0 deletions(-)
 create mode 100644 board/linkstation/Makefile
 create mode 100644 board/linkstation/avr.c
 create mode 100644 board/linkstation/config.mk
 create mode 100644 board/linkstation/hwctl.c
 create mode 100644 board/linkstation/ide.c
 create mode 100644 board/linkstation/linkstation.c
 create mode 100644 include/configs/linkstation.h
MAKEALL +1 -0
index 0e1c0cb..9110a4a 100755
@@ -256,6 +256,7 @@ LIST_824x="		\
 	debris		\
 	eXalion		\
 	HIDDEN_DRAGON	\
+	linkstation_HGLAN	\
 	MOUSSE		\
 	MUSENKI		\
 	MVBLUE		\
Makefile +12 -0
index d6a0299..f41a422 100644
@@ -1481,6 +1481,18 @@ HIDDEN_DRAGON_config: unconfig
 kvme080_config: unconfig
 	@$(MKCONFIG) $(@:_config=) ppc mpc824x kvme080 etin
 
+# HDLAN is broken ATM. Should be fixed as soon as hardware is available and as
+# time permits.
+#linkstation_HDLAN_config \
+# Remove this line when HDLAN is fixed
+linkstation_HGLAN_config: unconfig
+	@mkdir -p $(obj)include
+	@case $@ in \
+		*HGLAN*) echo "#define CONFIG_HGLAN 1" >$(obj)include/config.h; ;; \
+		*HDLAN*) echo "#define CONFIG_HLAN 1" >$(obj)include/config.h; ;; \
+	esac
+	@$(MKCONFIG) -n $@ -a linkstation ppc mpc824x linkstation
+
 MOUSSE_config: unconfig
 	@$(MKCONFIG) $(@:_config=) ppc mpc824x mousse
 
board/linkstation/Makefile new file +40 -0
new file mode 100644
index 0000000..57c84de
@@ -0,0 +1,40 @@
+#
+# (C) Copyright 2001
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= lib$(BOARD).a
+
+OBJS	= $(BOARD).o ide.o hwctl.o avr.o
+
+$(LIB):	.depend $(OBJS) $(SOBJS)
+	$(AR) crv $@ $(OBJS) $(SOBJS)
+
+#########################################################################
+
+.depend:	Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
+		$(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+
+sinclude .depend
+
+#########################################################################
board/linkstation/avr.c new file +293 -0

293 lines not on this page · raw message

board/linkstation/config.mk new file +50 -0

50 lines not on this page · raw message

board/linkstation/hwctl.c new file +135 -0

135 lines not on this page · raw message

board/linkstation/ide.c new file +99 -0

99 lines not on this page · raw message

board/linkstation/linkstation.c new file +130 -0

130 lines not on this page · raw message

include/configs/linkstation.h new file +507 -0

507 lines not on this page · raw message

Signature · 1 line
1.5.4
#1 lore raw

PATCH 2/2 Support for LinkStation / KuroBox HD and HG PPC models

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

This patch is based on the port by Mihai Georgian (see linkstation.c for Copyright information) and implements support for LinkStation / KuroBox HD and HG PPC models from Buffalo Technology, whereby HD is deactivated at the moment, pending network driver fixing.

Notice to users: this is pretty much a barebone port. Support for network on HG models is already in the U-Boot mainline, but you might also want patches to switch fan / phy modes depending on the negotiated ethernet parameters. This patch also doesn't support console switching, booting EM mode, Buffalo specific ext2 magic number. So, if you want to use any of those, you need additional patches. Otherwise this patche provides a fully functional u-boot with a network console on your system.

---

As the comment in the Makefile states, HD is disabled at the moment due to a problem with the network driver, which has to be investigated further, as hardware availability and time permit.

Quoted 11 lines
 MAKEALL                         |    1 +
 Makefile                        |   12 ++
 board/linkstation/Makefile      |   40 +++
 board/linkstation/avr.c         |  293 ++++++++++++++++++++++
 board/linkstation/config.mk     |   50 ++++
 board/linkstation/hwctl.c       |  135 +++++++++++
 board/linkstation/ide.c         |   99 ++++++++
 board/linkstation/linkstation.c |  130 ++++++++++
 include/configs/linkstation.h   |  509 +++++++++++++++++++++++++++++++++++++++
 9 files changed, 1267 insertions(+), 0 deletions(-)
 create mode 100644 board/linkstation/Makefile
 create mode 100644 board/linkstation/avr.c
Quoted 5 lines
 create mode 100644 board/linkstation/config.mk
 create mode 100644 board/linkstation/hwctl.c
 create mode 100644 board/linkstation/ide.c
 create mode 100644 board/linkstation/linkstation.c
 create mode 100644 include/configs/linkstation.h

Applied, thanks.

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
Time is an illusion perpetrated by the manufacturers of space.
#2 lore raw

PATCH 2/2 Support for LinkStation / KuroBox HD and HG PPC models

In reply to Guennadi Liakhovetski
Quoted 4 lines · In message <[email protected]> you wrote:

This patch is based on the port by Mihai Georgian (see linkstation.c for Copyright information) and implements support for LinkStation / KuroBox HD and HG PPC models from Buffalo Technology, whereby HD is deactivated at the moment, pending network driver fixing.

The code throws a lot of compiler warnings:

===== LOG/linkstation_HGLAN =====
hwctl.c: In function 'miconCntl_SendUart':
hwctl.c:30: warning: pointer targets in passing argument 1 of 'out_8' differ in signedness rtl8169.c: In function 'rtl_recv':
rtl8169.c:438: warning: passing argument 1 of '__fswab32' makes integer from pointer without a cast rtl8169.c: In function 'rtl_send':
rtl8169.c:484: warning: passing argument 1 of '__fswab32' makes integer from pointer without a cast rtl8169.c: In function 'rtl8169_hw_start':
rtl8169.c:582: warning: passing argument 2 of 'out_le32' makes integer from pointer without a cast rtl8169.c:583: warning: passing argument 2 of 'out_le32' makes integer from pointer without a cast rtl8169.c: In function 'rtl8169_init_ring':
rtl8169.c:628: warning: passing argument 1 of '__fswab32' makes integer from pointer without a cast cmd_ide.c: In function 'ide_read':
cmd_ide.c:1267: warning: integer constant is too large for 'long' type cmd_ide.c:1321: warning: right shift count >= width of type
cmd_ide.c:1322: warning: right shift count >= width of type
cmd_ide.c: In function 'ide_write':
cmd_ide.c:1386: warning: integer constant is too large for 'long' type cmd_ide.c:1411: warning: right shift count >= width of type
cmd_ide.c:1412: warning: right shift count >= width of type

Also, ther eis no entry for this board in the MAINTAINERS file.

Please fix. Thanks in advance.

Best regards,

Wolfgang Denk

Signature · 6 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
In the beginning there was nothing.
And the Lord said "Let There Be Light!"
And still there was nothing, but at least now you could see it.
#3 lore raw

PATCH 1/1 LinkStation: fix compiler warning, add a maintainer

out_8 wants a pointer to an unsigned as the first argument. Add a maintainer for Linkstation boards.

---

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

This patch is based on the port by Mihai Georgian (see linkstation.c for Copyright information) and implements support for LinkStation / KuroBox HD and HG PPC models from Buffalo Technology, whereby HD is deactivated at the moment, pending network driver fixing.

The code throws a lot of compiler warnings:

===== LOG/linkstation_HGLAN =====
hwctl.c: In function 'miconCntl_SendUart':
hwctl.c:30: warning: pointer targets in passing argument 1 of 'out_8' differ in signedness

Patch below.

board/linkstation/hwctl.c +1 -1
index 9db128a..2e5b5c8 100644
@@ -27,7 +27,7 @@
 /*--------------------------------------------------------------*/
 static inline void miconCntl_SendUart(unsigned char dat)
 {
-	out_8((char *)AVR_PORT, dat);
+	out_8((unsigned char *)AVR_PORT, dat);
 	mdelay(1);
 }
 
MAINTAINERS +4 -0
index d1782b4..58f833c 100644
@@ -408,6 +408,10 @@ John Zhan <[email protected]>
 
 	svm_sc8xx		MPC8xx
 
+Guennadi Liakhovetski <[email protected]>
+
+	linkstation		MPC8241
+
 -------------------------------------------------------------------------
 
 Unknown / orphaned boards:
#4 lore raw

PATCH 1/1 LinkStation: fix compiler warning, add a maintainer

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

out_8 wants a pointer to an unsigned as the first argument. Add a maintainer for Linkstation boards.

Applied, thanks.

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
The heart is not a logical organ.
	-- Dr. Janet Wallace, "The Deadly Years", stardate 3479.4
#5 lore raw

PATCH 1/1 IDE: fix compiler warnings

In reply to Wolfgang Denk

The IDE driver can use 32-bit addresses in LBA mode, in which case it spits multiple warnings during compilation. Fix them.

---

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

This patch is based on the port by Mihai Georgian (see linkstation.c for Copyright information) and implements support for LinkStation / KuroBox HD and HG PPC models from Buffalo Technology, whereby HD is deactivated at the moment, pending network driver fixing.

The code throws a lot of compiler warnings:

Quoted 9 lines

===== LOG/linkstation_HGLAN =====
cmd_ide.c: In function 'ide_read':
cmd_ide.c:1267: warning: integer constant is too large for 'long' type cmd_ide.c:1321: warning: right shift count >= width of type cmd_ide.c:1322: warning: right shift count >= width of type cmd_ide.c: In function 'ide_write':
cmd_ide.c:1386: warning: integer constant is too large for 'long' type cmd_ide.c:1411: warning: right shift count >= width of type cmd_ide.c:1412: warning: right shift count >= width of type

I think, these have been there for a while, in any case, patch below. Haven't found an IDE custodian.

common/cmd_ide.c +12 -2
index 8ace970..a3ba353 100644
@@ -1264,7 +1264,7 @@ ulong ide_read (int device, lbaint_t blknr, ulong blkcnt, void *buffer)
 #ifdef CONFIG_LBA48
 	unsigned char lba48 = 0;
 
-	if (blknr & 0x0000fffff0000000) {
+	if (blknr & 0x0000fffff0000000ULL) {
 		/* more than 28 bits used, use 48bit mode */
 		lba48 = 1;
 	}
@@ -1318,8 +1318,13 @@ ulong ide_read (int device, lbaint_t blknr, ulong blkcnt, void *buffer)
 			/* write high bits */
 			ide_outb (device, ATA_SECT_CNT, 0);
 			ide_outb (device, ATA_LBA_LOW,	(blknr >> 24) & 0xFF);
+#ifdef CFG_64BIT_LBA
 			ide_outb (device, ATA_LBA_MID,	(blknr >> 32) & 0xFF);
 			ide_outb (device, ATA_LBA_HIGH, (blknr >> 40) & 0xFF);
+#else
+			ide_outb (device, ATA_LBA_MID,	0);
+			ide_outb (device, ATA_LBA_HIGH, 0);
+#endif
 		}
 #endif
 		ide_outb (device, ATA_SECT_CNT, 1);
@@ -1383,7 +1388,7 @@ ulong ide_write (int device, lbaint_t blknr, ulong blkcnt, void *buffer)
 #ifdef CONFIG_LBA48
 	unsigned char lba48 = 0;
 
-	if (blknr & 0x0000fffff0000000) {
+	if (blknr & 0x0000fffff0000000ULL) {
 		/* more than 28 bits used, use 48bit mode */
 		lba48 = 1;
 	}
@@ -1408,8 +1413,13 @@ ulong ide_write (int device, lbaint_t blknr, ulong blkcnt, void *buffer)
 			/* write high bits */
 			ide_outb (device, ATA_SECT_CNT, 0);
 			ide_outb (device, ATA_LBA_LOW,	(blknr >> 24) & 0xFF);
+#ifdef CFG_64BIT_LBA
 			ide_outb (device, ATA_LBA_MID,	(blknr >> 32) & 0xFF);
 			ide_outb (device, ATA_LBA_HIGH, (blknr >> 40) & 0xFF);
+#else
+			ide_outb (device, ATA_LBA_MID,	0);
+			ide_outb (device, ATA_LBA_HIGH, 0);
+#endif
 		}
 #endif
 		ide_outb (device, ATA_SECT_CNT, 1);
#6 lore raw

PATCH 1/1 IDE: fix compiler warnings

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

The IDE driver can use 32-bit addresses in LBA mode, in which case it spits multiple warnings during compilation. Fix them.

Applied, thanks.

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
On a clear disk you can seek forever.
#7 lore raw

PATCH 1/1 rtl8169: fix compiler warnings

In reply to Wolfgang Denk

Fix multiple compiler warnings related to argument type mismatch.

---

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

This patch is based on the port by Mihai Georgian (see linkstation.c for Copyright information) and implements support for LinkStation / KuroBox HD and HG PPC models from Buffalo Technology, whereby HD is deactivated at the moment, pending network driver fixing.

The code throws a lot of compiler warnings:

Quoted 10 lines

===== LOG/linkstation_HGLAN =====
rtl8169.c: In function 'rtl_recv':
rtl8169.c:438: warning: passing argument 1 of '__fswab32' makes integer from pointer without a cast rtl8169.c: In function 'rtl_send':
rtl8169.c:484: warning: passing argument 1 of '__fswab32' makes integer from pointer without a cast rtl8169.c: In function 'rtl8169_hw_start':
rtl8169.c:582: warning: passing argument 2 of 'out_le32' makes integer from pointer without a cast rtl8169.c:583: warning: passing argument 2 of 'out_le32' makes integer from pointer without a cast rtl8169.c: In function 'rtl8169_init_ring':
rtl8169.c:628: warning: passing argument 1 of '__fswab32' makes integer from pointer without a cast

Patch below.

drivers/net/rtl8169.c +5 -5
index d39ac7c..6c4c9ff 100644
@@ -435,7 +435,7 @@ static int rtl_recv(struct eth_device *dev)
 				tpc->RxDescArray[cur_rx].status =
 					cpu_to_le32(OWNbit + RX_BUF_SIZE);
 			tpc->RxDescArray[cur_rx].buf_addr =
-				cpu_to_le32(tpc->RxBufferRing[cur_rx]);
+				cpu_to_le32((unsigned long)tpc->RxBufferRing[cur_rx]);
 		} else {
 			puts("Error Rx");
 		}
@@ -481,7 +481,7 @@ static int rtl_send(struct eth_device *dev, volatile void *packet, int length)
 	while (len < ETH_ZLEN)
 		ptxb[len++] = '\0';
 
-	tpc->TxDescArray[entry].buf_addr = cpu_to_le32(ptxb);
+	tpc->TxDescArray[entry].buf_addr = cpu_to_le32((unsigned long)ptxb);
 	if (entry != (NUM_TX_DESC - 1)) {
 		tpc->TxDescArray[entry].status =
 			cpu_to_le32((OWNbit | FSbit | LSbit) |
@@ -579,8 +579,8 @@ static void rtl8169_hw_start(struct eth_device *dev)
 
 	tpc->cur_rx = 0;
 
-	RTL_W32(TxDescStartAddr, tpc->TxDescArray);
-	RTL_W32(RxDescStartAddr, tpc->RxDescArray);
+	RTL_W32(TxDescStartAddr, (unsigned long)tpc->TxDescArray);
+	RTL_W32(RxDescStartAddr, (unsigned long)tpc->RxDescArray);
 	RTL_W8(Cfg9346, Cfg9346_Lock);
 	udelay(10);
 
@@ -625,7 +625,7 @@ static void rtl8169_init_ring(struct eth_device *dev)
 
 		tpc->RxBufferRing[i] = &rxb[i * RX_BUF_SIZE];
 		tpc->RxDescArray[i].buf_addr =
-			cpu_to_le32(tpc->RxBufferRing[i]);
+			cpu_to_le32((unsigned long)tpc->RxBufferRing[i]);
 	}
 
 #ifdef DEBUG_RTL8169
#8 lore raw

PATCH 1/1 rtl8169: fix compiler warnings

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

Fix multiple compiler warnings related to argument type mismatch.

Applied, thanks.

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
CAUTION:  The Mass of This Product Contains the Energy Equivalent  of
85 Million Tons of TNT per Net Ounce of Weight.