Skip to contentSkip to conversation

8xx, kup4: minor configuration changes

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

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 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

 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 ++++++++-------------------
 include/configs/KUP4K.h    |  169 ++++++++++--------
 include/configs/KUP4X.h    |   64 ++++----
 7 files changed, 426 insertions(+), 783 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

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 v2 1/2 8xx, kup4: minor configuration changes

Dear Heiko Schocher,

Quoted 16 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

Quoted 9 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 ++++++++-------------------
 include/configs/KUP4K.h    |  169 ++++++++++--------
 include/configs/KUP4X.h    |   64 ++++----
 7 files changed, 426 insertions(+), 783 deletions(-)
 delete mode 100644 board/kup/kup4k/s1d13706.h

Applied, thanks.

Heiko, I had some merge conflicts in board/kup/kup4k/kup4k.c

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

Thanks.

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Es ist offensichtlich, dass das menschliche Gehirn wie  ein  Computer
funktioniert.  Da  es  keine  dummen Computer gibt, gibt es also auch
keine dummen Menschen. Nur ein paar Leute, die unter DOS laufen.
                                                       -- <unbekannt>