Skip to contentSkip to conversation

8xx, kup4: minor configuration changes

PATCH New Heiko Schocher 2 participants 2 messages Jul 19, 2010 – Aug 8, 2010

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/2 8xx, kup4: minor configuration changes

- nfs-options removed
- hda->sda changed
- mtd parts added
- loadaddress changed
- cmd-line length increased
- lcd stuff removed
- code cleanup

---
- changes since v1:
- added comments from Wolfgang Denk
- fix Codingstyle issues
- rebased against current mainline

- changes since v2
fix boards.cfg entry for kup4x board

 board/kup/common/kup.c     |   54 ++++--
 board/kup/common/kup.h     |   44 +++--
 board/kup/kup4k/kup4k.c    |  439 +++++++++++++++++---------------------------
 board/kup/kup4k/s1d13706.h |  174 -----------------
 board/kup/kup4x/kup4x.c    |  265 ++++++++-------------------
 boards.cfg                 |    2 +-
 include/configs/KUP4K.h    |  169 ++++++++++--------
 include/configs/KUP4X.h    |   64 ++++----
 8 files changed, 427 insertions(+), 784 deletions(-)
 delete mode 100644 board/kup/kup4k/s1d13706.h
board/kup/common/kup.c +33 -21
index 2418d59..38259a5 100644
@@ -24,49 +24,61 @@
 #include <common.h>
 #include <mpc8xx.h>
 #include "kup.h"
+#include <asm/io.h>
 
-int misc_init_f (void)
+
+int misc_init_f(void)
 {
 	volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
 	volatile sysconf8xx_t *siu = &immap->im_siu_conf;
 
-	while (siu->sc_sipend & 0x20000000) {
-		/* printf("waiting for 5V VCC\n"); */
-		;
+	while (in_be32(&siu->sc_sipend) & 0x20000000) {
+		debug("waiting for 5V VCC\n");
 	}
 
 	/* RS232 / RS485 default is RS232 */
-	immap->im_ioport.iop_padat &= ~(PA_RS485);
-	immap->im_ioport.iop_papar &= ~(PA_RS485);
-	immap->im_ioport.iop_paodr &= ~(PA_RS485);
-	immap->im_ioport.iop_padir |= (PA_RS485);
+	clrbits_be16(&immap->im_ioport.iop_padat, PA_RS485);
+	clrbits_be16(&immap->im_ioport.iop_papar, PA_RS485);
+	clrbits_be16(&immap->im_ioport.iop_paodr, PA_RS485);
+	setbits_be16(&immap->im_ioport.iop_padir, PA_RS485);
+
+	/* IO Reset min 1 msec */
+	setbits_be16(&immap->im_ioport.iop_padat,
+				 (PA_RESET_IO_01 | PA_RESET_IO_02));
+	clrbits_be16(&immap->im_ioport.iop_papar,
+				 (PA_RESET_IO_01 | PA_RESET_IO_02));
+	clrbits_be16(&immap->im_ioport.iop_paodr,
+				 (PA_RESET_IO_01 | PA_RESET_IO_02));
+	setbits_be16(&immap->im_ioport.iop_padir,
+				 (PA_RESET_IO_01 | PA_RESET_IO_02));
+	udelay(1000);
+	clrbits_be16(&immap->im_ioport.iop_padat,
+				 (PA_RESET_IO_01 | PA_RESET_IO_02));
 	return (0);
 }
 
-
 #ifdef CONFIG_IDE_LED
-void ide_led (uchar led, uchar status)
+void ide_led(uchar led, uchar status)
 {
 	volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
 
 	/* We have one led for both pcmcia slots */
-	if (status) {		/* led on */
-		immap->im_ioport.iop_padat &= ~(PA_LED_YELLOW);
-	} else {
-		immap->im_ioport.iop_padat |= (PA_LED_YELLOW);
-	}
+	if (status)
+		clrbits_be16(&immap->im_ioport.iop_padat, PA_LED_YELLOW);
+	else
+		setbits_be16(&immap->im_ioport.iop_padat, PA_LED_YELLOW);
 }
 #endif
 
-void poweron_key (void)
+void poweron_key(void)
 {
 	volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
 
-	immap->im_ioport.iop_pcpar &= ~(PC_SWITCH1);
-	immap->im_ioport.iop_pcdir &= ~(PC_SWITCH1);
+	clrbits_be16(&immap->im_ioport.iop_pcpar, PC_SWITCH1);
+	clrbits_be16(&immap->im_ioport.iop_pcdir, PC_SWITCH1);
 
-	if (immap->im_ioport.iop_pcdat & (PC_SWITCH1))
-		setenv ("key1", "off");
+	if (in_be16(&immap->im_ioport.iop_pcdat) & (PC_SWITCH1))
+		setenv("key1", "off");
 	else
-		setenv ("key1", "on");
+		setenv("key1", "on");
 }
board/kup/common/kup.h +27 -17

50 lines not on this page · raw message

board/kup/kup4k/kup4k.c +164 -275

539 lines not on this page · raw message

board/kup/kup4k/s1d13706.h deleted +0 -174

174 lines not on this page · raw message

board/kup/kup4x/kup4x.c +77 -188

312 lines not on this page · raw message

boards.cfg +1 -1
index b82f530..9d5639e 100644
@@ -160,7 +160,7 @@ TOP860		powerpc	mpc8xx		top860		emk
 kmsupx4		powerpc	mpc8xx		km8xx		keymile
 mgsuvd		powerpc	mpc8xx		km8xx		keymile
 KUP4K		powerpc	mpc8xx		kup4k		kup
-KUP4X		powerpc	mpc8xx		kup4k		kup
+KUP4X		powerpc	mpc8xx		kup4x		kup
 ELPT860		powerpc	mpc8xx		elpt860		LEOX
 CCM		powerpc	mpc8xx		-		siemens
 IAD210		powerpc	mpc8xx		-		siemens
include/configs/KUP4K.h +93 -76

303 lines not on this page · raw message

include/configs/KUP4X.h +32 -32

133 lines not on this page · raw message

Signature · 5 lines
1.6.2.5

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#1 lore raw

PATCH v3 1/2 8xx, kup4: minor configuration changes

Dear Heiko Schocher,

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

- nfs-options removed
- hda->sda changed
- mtd parts added
- loadaddress changed
- cmd-line length increased
- lcd stuff removed
- code cleanup

---
- changes since v1:
- added comments from Wolfgang Denk
- fix Codingstyle issues
- rebased against current mainline

- changes since v2
fix boards.cfg entry for kup4x board

Quoted 10 lines
 board/kup/common/kup.c     |   54 ++++--
 board/kup/common/kup.h     |   44 +++--
 board/kup/kup4k/kup4k.c    |  439 +++++++++++++++++---------------------------
 board/kup/kup4k/s1d13706.h |  174 -----------------
 board/kup/kup4x/kup4x.c    |  265 ++++++++-------------------
 boards.cfg                 |    2 +-
 include/configs/KUP4K.h    |  169 ++++++++++--------
 include/configs/KUP4X.h    |   64 ++++----
 8 files changed, 427 insertions(+), 784 deletions(-)
 delete mode 100644 board/kup/kup4k/s1d13706.h

Backed out previous version, applied this one instead.

Heiko, please make sure to set the In-reply-to: / References: headers to keep threading in place, so I can see in the mailer when a later version of a patch gets posted. Thanks.

I still had the same merge conflicts in board/kup/kup4k/kup4k.c

Could you please check that the result is what you expect?

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 IQ of the group is the lowest IQ of a member of the group divided
by the number of people in the group.