This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
iPAQ - support Compaq dual PCMCIA sleeve
- From: Gary Thomas <gthomas at ecoscentric dot com>
- To: eCos patches <ecos-patches at sources dot redhat dot com>
- Date: 20 Sep 2002 15:34:28 -0600
- Subject: iPAQ - support Compaq dual PCMCIA sleeve
Note: this seems to work fine with newer Socket (CF) cards, but not
some of the older ones. I'm still looking into this problem.
Index: devs/pcmcia/arm/ipaq/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/devs/pcmcia/arm/ipaq/current/ChangeLog,v
retrieving revision 1.4
diff -u -5 -p -r1.4 ChangeLog
--- devs/pcmcia/arm/ipaq/current/ChangeLog 23 May 2002 23:01:07 -0000 1.4
+++ devs/pcmcia/arm/ipaq/current/ChangeLog 20 Sep 2002 21:15:57 -0000
@@ -1,5 +1,10 @@
+2002-09-20 Gary Thomas <gthomas@ecoscentric.com>
+
+ * src/ipaq_pcmcia.c: Additional setup required for Compaq dual
+ PCMCIA sleeve.
+
2002-04-12 Gary Thomas <gthomas@redhat.com>
* src/ipaq_pcmcia.c: Clean up warnings.
2001-07-13 Gary Thomas <gthomas@redhat.com>
Index: devs/pcmcia/arm/ipaq/current/src/ipaq_pcmcia.c
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/devs/pcmcia/arm/ipaq/current/src/ipaq_pcmcia.c,v
retrieving revision 1.4
diff -u -5 -p -r1.4 ipaq_pcmcia.c
--- devs/pcmcia/arm/ipaq/current/src/ipaq_pcmcia.c 23 May 2002 23:01:08 -0000 1.4
+++ devs/pcmcia/arm/ipaq/current/src/ipaq_pcmcia.c 20 Sep 2002 21:15:57 -0000
@@ -7,10 +7,11 @@
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 2002 Gary Thomas
//
// eCos 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 or (at your option) any later version.
//
@@ -230,10 +231,17 @@ cf_hwr_change_state(struct cf_slot *slot
slot->state = CF_SLOT_STATE_Powered;
ipaq_EGPIO( SA1110_EIO_CF_RESET, SA1110_EIO_CF_RESET_ENABLE);
do_delay(1); // At least 10 us
slot->state = CF_SLOT_STATE_Reset;
ipaq_EGPIO( SA1110_EIO_CF_RESET, SA1110_EIO_CF_RESET_DISABLE);
+ do_delay(5); // At least 20 ms
+ // This is necessary for the two slot sleeve and doesn't seem to
+ // hurt on the single slot versions. Note: only 3.3V is ever used!
+ *(volatile unsigned short *)IPAQ_CF_CTRL = IPAQ_CF_CTRL_V5_DISABLE |
+ IPAQ_CF_CTRL_V3_ENABLE |
+ IPAQ_CF_CTRL_APOE_ENABLE |
+ IPAQ_CF_CTRL_SOE_ENABLE;
do_delay(5); // At least 20 ms
// Wait until the card is ready to talk
for (i = 0; i < 10; i++) {
ptr = 0;
if (cf_get_CIS(slot, CF_CISTPL_VERS_1, buf, &len, &ptr)) {
Index: hal/arm/sa11x0/ipaq/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/hal/arm/sa11x0/ipaq/current/ChangeLog,v
retrieving revision 1.13
diff -u -5 -p -r1.13 ChangeLog
--- hal/arm/sa11x0/ipaq/current/ChangeLog 12 Aug 2002 21:28:27 -0000 1.13
+++ hal/arm/sa11x0/ipaq/current/ChangeLog 20 Sep 2002 21:16:38 -0000
@@ -1,5 +1,10 @@
+2002-09-20 Gary Thomas <gthomas@ecoscentric.com>
+
+ * include/ipaq.h: Define "LinkUP Systems" PCMCIA controller. Used
+ on Compaq dual PCMCIA sleeve.
+
2002-08-12 Mark Salter <msalter@redhat.com>
* misc/redboot_ROM.ecm: Remove CYGSEM_REDBOOT_ARM_LINUX_BOOT.
* misc/redboot_RAM.ecm: Ditto.
Index: hal/arm/sa11x0/ipaq/current/include/ipaq.h
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/hal/arm/sa11x0/ipaq/current/include/ipaq.h,v
retrieving revision 1.3
diff -u -5 -p -r1.3 ipaq.h
--- hal/arm/sa11x0/ipaq/current/include/ipaq.h 23 May 2002 23:02:22 -0000 1.3
+++ hal/arm/sa11x0/ipaq/current/include/ipaq.h 20 Sep 2002 21:16:39 -0000
@@ -10,10 +10,11 @@
//=============================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 2002 Gary Thomas
//
// eCos 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 or (at your option) any later version.
//
@@ -70,67 +71,67 @@ extern void ipaq_EGPIO(unsigned long mas
#endif
//
// Signal assertion levels
//
-#define SA1110_LOGIC_ONE(m) (m & 0xFFFF)
-#define SA1110_LOGIC_ZERO(m) (m & 0x0000)
+#define _LOGIC_ONE(m) (m & 0xFFFF)
+#define _LOGIC_ZERO(m) (m & 0x0000)
//
// iPAQ Extended GPIO definitions
//
#define SA1110_EGPIO REG16_PTR(0x49000000)
#define SA1110_EIO_MIN 0x0080
#define SA1110_EIO_VPP 0x0001
-# define SA1110_EIO_VPP_OFF SA1110_LOGIC_ZERO(SA1110_EIO_VPP)
-# define SA1110_EIO_VPP_ON SA1110_LOGIC_ONE(SA1110_EIO_VPP)
+# define SA1110_EIO_VPP_OFF _LOGIC_ZERO(SA1110_EIO_VPP)
+# define SA1110_EIO_VPP_ON _LOGIC_ONE(SA1110_EIO_VPP)
#define SA1110_EIO_CF_RESET 0x0002
-# define SA1110_EIO_CF_RESET_DISABLE SA1110_LOGIC_ZERO(SA1110_EIO_CF_RESET)
-# define SA1110_EIO_CF_RESET_ENABLE SA1110_LOGIC_ONE(SA1110_EIO_CF_RESET)
+# define SA1110_EIO_CF_RESET_DISABLE _LOGIC_ZERO(SA1110_EIO_CF_RESET)
+# define SA1110_EIO_CF_RESET_ENABLE _LOGIC_ONE(SA1110_EIO_CF_RESET)
#define SA1110_EIO_OPT_RESET 0x0004
-# define SA1110_EIO_OPT_RESET_DISABLE SA1110_LOGIC_ZERO(SA1110_EIO_OPT_RESET)
-# define SA1110_EIO_OPT_RESET_ENABLE SA1110_LOGIC_ONE(SA1110_EIO_OPT_RESET)
+# define SA1110_EIO_OPT_RESET_DISABLE _LOGIC_ZERO(SA1110_EIO_OPT_RESET)
+# define SA1110_EIO_OPT_RESET_ENABLE _LOGIC_ONE(SA1110_EIO_OPT_RESET)
#define SA1110_EIO_CODEC_RESET 0x0008 // Active LOW
-# define SA1110_EIO_CODEC_RESET_DISABLE SA1110_LOGIC_ONE(SA1110_EIO_CODEC_RESET)
-# define SA1110_EIO_CODEC_RESET_ENABLE SA1110_LOGIC_ZERO(SA1110_EIO_CODEC_RESET)
+# define SA1110_EIO_CODEC_RESET_DISABLE _LOGIC_ONE(SA1110_EIO_CODEC_RESET)
+# define SA1110_EIO_CODEC_RESET_ENABLE _LOGIC_ZERO(SA1110_EIO_CODEC_RESET)
#define SA1110_EIO_OPT_PWR 0x0010
-# define SA1110_EIO_OPT_PWR_OFF SA1110_LOGIC_ZERO(SA1110_EIO_OPT_PWR)
-# define SA1110_EIO_OPT_PWR_ON SA1110_LOGIC_ONE(SA1110_EIO_OPT_PWR)
+# define SA1110_EIO_OPT_PWR_OFF _LOGIC_ZERO(SA1110_EIO_OPT_PWR)
+# define SA1110_EIO_OPT_PWR_ON _LOGIC_ONE(SA1110_EIO_OPT_PWR)
#define SA1110_EIO_OPT 0x0020
-# define SA1110_EIO_OPT_OFF SA1110_LOGIC_ZERO(SA1110_EIO_OPT)
-# define SA1110_EIO_OPT_ON SA1110_LOGIC_ONE(SA1110_EIO_OPT)
+# define SA1110_EIO_OPT_OFF _LOGIC_ZERO(SA1110_EIO_OPT)
+# define SA1110_EIO_OPT_ON _LOGIC_ONE(SA1110_EIO_OPT)
#define SA1110_EIO_LCD_3V3 0x0040
-# define SA1110_EIO_LCD_3V3_OFF SA1110_LOGIC_ZERO(SA1110_EIO_LCD_3V3)
-# define SA1110_EIO_LCD_3V3_ON SA1110_LOGIC_ONE(SA1110_EIO_LCD_3V3)
+# define SA1110_EIO_LCD_3V3_OFF _LOGIC_ZERO(SA1110_EIO_LCD_3V3)
+# define SA1110_EIO_LCD_3V3_ON _LOGIC_ONE(SA1110_EIO_LCD_3V3)
#define SA1110_EIO_RS232 0x0080
-# define SA1110_EIO_RS232_OFF SA1110_LOGIC_ZERO(SA1110_EIO_RS232)
-# define SA1110_EIO_RS232_ON SA1110_LOGIC_ONE(SA1110_EIO_RS232)
+# define SA1110_EIO_RS232_OFF _LOGIC_ZERO(SA1110_EIO_RS232)
+# define SA1110_EIO_RS232_ON _LOGIC_ONE(SA1110_EIO_RS232)
#define SA1110_EIO_LCD_CTRL 0x0100
-# define SA1110_EIO_LCD_CTRL_OFF SA1110_LOGIC_ZERO(SA1110_EIO_LCD_CTRL)
-# define SA1110_EIO_LCD_CTRL_ON SA1110_LOGIC_ONE(SA1110_EIO_LCD_CTRL)
+# define SA1110_EIO_LCD_CTRL_OFF _LOGIC_ZERO(SA1110_EIO_LCD_CTRL)
+# define SA1110_EIO_LCD_CTRL_ON _LOGIC_ONE(SA1110_EIO_LCD_CTRL)
#define SA1110_EIO_IR 0x0200
-# define SA1110_EIO_IR_OFF SA1110_LOGIC_ZERO(SA1110_EIO_IR)
-# define SA1110_EIO_IR_ON SA1110_LOGIC_ONE(SA1110_EIO_IR)
+# define SA1110_EIO_IR_OFF _LOGIC_ZERO(SA1110_EIO_IR)
+# define SA1110_EIO_IR_ON _LOGIC_ONE(SA1110_EIO_IR)
#define SA1110_EIO_AMP 0x0400
-# define SA1110_EIO_AMP_OFF SA1110_LOGIC_ZERO(SA1110_EIO_AMP)
-# define SA1110_EIO_AMP_ON SA1110_LOGIC_ONE(SA1110_EIO_AMP)
+# define SA1110_EIO_AMP_OFF _LOGIC_ZERO(SA1110_EIO_AMP)
+# define SA1110_EIO_AMP_ON _LOGIC_ONE(SA1110_EIO_AMP)
#define SA1110_EIO_AUDIO 0x0800
-# define SA1110_EIO_AUDIO_OFF SA1110_LOGIC_ZERO(SA1110_EIO_AUDIO)
-# define SA1110_EIO_AUDIO_ON SA1110_LOGIC_ONE(SA1110_EIO_AUDIO)
+# define SA1110_EIO_AUDIO_OFF _LOGIC_ZERO(SA1110_EIO_AUDIO)
+# define SA1110_EIO_AUDIO_ON _LOGIC_ONE(SA1110_EIO_AUDIO)
#define SA1110_EIO_MUTE 0x1000
-# define SA1110_EIO_MUTE_OFF SA1110_LOGIC_ZERO(SA1110_EIO_MUTE)
-# define SA1110_EIO_MUTE_ON SA1110_LOGIC_ONE(SA1110_EIO_MUTE)
+# define SA1110_EIO_MUTE_OFF _LOGIC_ZERO(SA1110_EIO_MUTE)
+# define SA1110_EIO_MUTE_ON _LOGIC_ONE(SA1110_EIO_MUTE)
#define SA1110_EIO_IR_FSEL 0x2000
-# define SA1110_EIO_SIR SA1110_LOGIC_ZERO(SA1110_EIO_IR_FSEL)
-# define SA1110_EIO_FIR SA1110_LOGIC_ONE(SA1110_EIO_IR_FSEL)
+# define SA1110_EIO_SIR _LOGIC_ZERO(SA1110_EIO_IR_FSEL)
+# define SA1110_EIO_FIR _LOGIC_ONE(SA1110_EIO_IR_FSEL)
#define SA1110_EIO_LCD_5V 0x4000
-# define SA1110_EIO_LCD_5V_OFF SA1110_LOGIC_ZERO(SA1110_EIO_LCD_5V)
-# define SA1110_EIO_LCD_5V_ON SA1110_LOGIC_ONE(SA1110_EIO_LCD_5V)
+# define SA1110_EIO_LCD_5V_OFF _LOGIC_ZERO(SA1110_EIO_LCD_5V)
+# define SA1110_EIO_LCD_5V_ON _LOGIC_ONE(SA1110_EIO_LCD_5V)
#define SA1110_EIO_LCD_VDD 0x8000
-# define SA1110_EIO_LCD_VDD_OFF SA1110_LOGIC_ZERO(SA1110_EIO_LCD_VDD)
-# define SA1110_EIO_LCD_VDD_ON SA1110_LOGIC_ONE(SA1110_EIO_LCD_VDD)
+# define SA1110_EIO_LCD_VDD_OFF _LOGIC_ZERO(SA1110_EIO_LCD_VDD)
+# define SA1110_EIO_LCD_VDD_ON _LOGIC_ONE(SA1110_EIO_LCD_VDD)
//
// Special purpose GPIO interrupt mappings
//
#define SA1110_CF_IRQ CYGNUM_HAL_INTERRUPT_GPIO21
@@ -138,12 +139,39 @@ extern void ipaq_EGPIO(unsigned long mas
//
// GPIO layout
//
#define SA1110_GPIO_CF_DETECT 0x00020000 // 0 = Compact Flash detect
-#define SA1110_GPIO_CF_PRESENT SA1110_LOGIC_ZERO(SA1110_GPIO_CF_DETECT)
-#define SA1110_GPIO_CF_ABSENT SA1110_LOGIC_ONE(SA1110_GPIO_CF_DETECT)
+#define SA1110_GPIO_CF_PRESENT _LOGIC_ZERO(SA1110_GPIO_CF_DETECT)
+#define SA1110_GPIO_CF_ABSENT _LOGIC_ONE(SA1110_GPIO_CF_DETECT)
+#define SA1110_GPIO_CF2_DETECT 0x00000200 // 0 = Second slot on 2-slot sleeve
+#define SA1110_GPIO_CF2_PRESENT _LOGIC_ZERO(SA1110_GPIO_CF2_DETECT)
+#define SA1110_GPIO_CF2_ABSENT _LOGIC_ONE(SA1110_GPIO_CF2_DETECT)
+
+//
+// PCMCIA controller in external sleeve
+//
+#define IPAQ_CF_CTRL 0x1A000000 // Slot 0 (same as single slot)
+#define IPAQ_CF2_CTRL 0x19000000 // Slot 1
+#define IPAQ_CF_CTRL_V5 0x0001 // 5v power enable
+#define IPAQ_CF_CTRL_V5_ENABLE _LOGIC_ZERO(IPAQ_CF_CTRL_V5)
+#define IPAQ_CF_CTRL_V5_DISABLE _LOGIC_ONE(IPAQ_CF_CTRL_V5)
+#define IPAQ_CF_CTRL_V3 0x0002 // 3v power enable
+#define IPAQ_CF_CTRL_V3_ENABLE _LOGIC_ZERO(IPAQ_CF_CTRL_V3)
+#define IPAQ_CF_CTRL_V3_DISABLE _LOGIC_ONE(IPAQ_CF_CTRL_V3)
+#define IPAQ_CF_CTRL_VCC 0x0004 // Vcc power enable
+#define IPAQ_CF_CTRL_V12 0x0008 // 12v power enable
+#define IPAQ_CF_CTRL_RESET 0x0010 // Reset card
+#define IPAQ_CF_CTRL_APOE 0x0020 // Auto power off
+#define IPAQ_CF_CTRL_APOE_ENABLE _LOGIC_ONE(IPAQ_CF_CTRL_APOE)
+#define IPAQ_CF_CTRL_APOE_DISABLE _LOGIC_ZERO(IPAQ_CF_CTRL_APOE)
+#define IPAQ_CF_CTRL_CFE 0x0040 // Compact Flash [addressing] enable
+#define IPAQ_CF_CTRL_SOE 0x0080 // Enable signal outputs
+#define IPAQ_CF_CTRL_SOE_ENABLE _LOGIC_ONE(IPAQ_CF_CTRL_SOE)
+#define IPAQ_CF_CTRL_SOE_DISABLE _LOGIC_ZERO(IPAQ_CF_CTRL_SOE)
+#define IPAQ_CF_CTRL_SSP 0x0100 // Slot polarity; slot0=0, slot1=1
+
//
// LCD Controller
//
#define SA1110_LCCR0 SA11X0_REGISTER(0x30100000)
--
------------------------------------------------------------
Gary Thomas |
eCosCentric, Ltd. |
+1 (970) 229-1963 | eCos & RedBoot experts
gthomas@ecoscentric.com |
http://www.ecoscentric.com/ |
------------------------------------------------------------