* PCMCIA on MBX860
@ 2001-02-03 18:34 Steve Clarke
2001-02-04 18:49 ` Paul Ruhland
0 siblings, 1 reply; 4+ messages in thread
From: Steve Clarke @ 2001-02-03 18:34 UTC (permalink / raw)
To: linuxppc-embedded
I would like to get PCMCIA working on an MBX860 running HardHat. There was a
thread in Nov 2000 on this topic between Paul Ruhland and Matthew Locke.
Based on this thread, I started with pcmcia-cs-3.1.24.
However, in 3.1.24 m8xx_pcmcia.c does not have references to the MBX board.
It supports RPXxxx, ADS and FADS. Paul's email on 11-21-2000 said that he
made MBX specific changes. Are these changes publicly available? If so, how
do I get these changes?
thanks,
stevec
-----------------------------------
Steve Clarke
Overture Networks
(919) 558-2200
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: PCMCIA on MBX860
2001-02-03 18:34 PCMCIA on MBX860 Steve Clarke
@ 2001-02-04 18:49 ` Paul Ruhland
2001-02-04 19:22 ` Paul Ruhland
0 siblings, 1 reply; 4+ messages in thread
From: Paul Ruhland @ 2001-02-04 18:49 UTC (permalink / raw)
To: Steve Clarke; +Cc: linuxppc-embedded
On Saturday 03 February 2001 13:34, Steve Clarke wrote:
> I would like to get PCMCIA working on an MBX860 running HardHat. There was
> a thread in Nov 2000 on this topic between Paul Ruhland and Matthew Locke.
> Based on this thread, I started with pcmcia-cs-3.1.24.
>
> However, in 3.1.24 m8xx_pcmcia.c does not have references to the MBX board.
> It supports RPXxxx, ADS and FADS. Paul's email on 11-21-2000 said that he
> made MBX specific changes. Are these changes publicly available? If so, how
> do I get these changes?
>
Steve,
I will send you the changes for the MBX860 in another reply tomorrow (
20010205 ). All of that code is presently on my work machine.
There are additions to 'pcmcia-cs-3.1.24/modules/m8xx_pcmcia.c' for board
specific voltage_set, hardware enable, and hardware disable. If you have
the MBX860 docs you may want to look at the CSR configuration...using the
hardware specific code already present in 'm8xx_pcmcia.c' you could add
support for the MBX...its not really to involved...basically you have to
control the pcmcia reset, buffer enable, and voltage select lines.
Also, some things to check to get the card services and socket driver running
on ppc:
After 'make install', assuming your using the SysV script layout, you have to
edit '/etc/sysconfig/pcmcia' ( on your target filesystem ) and change the
following line:
PCIC=i82365
to this:
PCIC=m8xx_pcmcia
Also, the 'pcmcia-cs-3.1.24/modules/cs.c' module is responsible for telling
the card driver which interrupt to use. This code seems broken for the
mpc850/860 ( always uses interrupt 0, which won't work ). I ended up
hardcoding this interrupt to 11 for both boards I've gotten pcmcia working on
( MBX860 and TQM850L ). In 'pcmcia-cs-3.1.24/modules/cs.c', in the
'cs_request_irq' function, I changed the initialization of the 'irq' var from
0 to 11. This is not the best solution but I haven't had time to do a proper
fix. It has to do with the fact that pcmcia on mpc850/860 is neither ISA or
PCI so the default just falls thru that function.
Also, I've experienced problems with the installed '/etc/pcmcia/network'
script...I would lose my nfs connection ( on eth0 ... SCCx ) when it tries to
bring up the pcmcia interface. I ended up writing a much simpler script
that just does the required 'ifconfig ...' to bring up the interface. I will
send you this as well...if your not using a network card it really doesn't
affect you.
There are also changes to the kernel...specifically in
'linux/include/asm-ppc/mpc8xx.h' and 'linux/arch/ppc/mm/init.c'. You have to
ioremap the PCMCIA_IO_ADDR or the kernel will panic when it tries setup the
serial io during boot and of course the card services won't work with out it.
Here is the relevant changes required in 'mpc8xx.h':
/* Currently, all 8xx boards that support a processor to PCI/ISA bridge
* use the same memory map.
*/
#if defined(CONFIG_PCI) && defined(PCI_ISA_IO_ADDR)
#define _IO_BASE PCI_ISA_IO_ADDR
#define _ISA_MEM_BASE PCI_ISA_MEM_ADDR
#define PCI_DRAM_OFFSET 0x80000000
#else
//#define _IO_BASE 0
#define _IO_BASE 0xEC000000 /* PCMCIA_IO_ADDR in board header */
#define _IO_BASE_SIZE 0x1000 /* PCMCIA_IO_SIZE */
#define _ISA_MEM_BASE 0
#define PCI_DRAM_OFFSET 0
#endif
For the MBX, I didn't use the board specific header defined
PCMCIA_IO_ADDR/PCMCIA_IO_SIZE because it contained a 'uint' reference that is
unknown to this section of code during compile. You must make sure this
address/size is the same one used by the pcmcia card services as well...it
uses the board specific header from the kernel source tree so it should be
ok. You may want to just remove the '(uint)' from
the'linux/include/asm-ppc/mbx.h' PCMCIA_IO_ADDR and PCMCIA_IO_SIZE
defines...this way you will be sure the kernel and pcmcia code are using the
same values. Also, while your at it, change the defined PCMCIA_IO_SIZE to
0x1000.
In 'linux/arch/ppc/mm/init.c' at approx. line 1160 you have to do the ioremap:
#ifdef CONFIG_MBX
ioremap(NVRAM_ADDR, NVRAM_SIZE);
ioremap(MBX_CSR_ADDR, MBX_CSR_SIZE);
ioremap(PCI_CSR_ADDR, PCI_CSR_SIZE);
/* Map some of the PCI/ISA I/O space to get the IDE interface.
*/
ioremap(PCI_ISA_IO_ADDR, 0x4000);
ioremap(PCI_IDE_ADDR, 0x4000);
/* map the pcmcia io space */
ioremap( PCMCIA_IO_ADDR, 0x1000);
#endif
#
I hope this wasn't too confusing...
-------------------------------
Paul Ruhland
Micrwave Data Systems Inc.
175 Science Parkway
Rochester, NY 14620
TEL: +1.716.242.8372
EMAIL: pruhland@microwavedata.com
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: PCMCIA on MBX860
2001-02-04 18:49 ` Paul Ruhland
@ 2001-02-04 19:22 ` Paul Ruhland
2001-02-04 19:27 ` Paul Ruhland
0 siblings, 1 reply; 4+ messages in thread
From: Paul Ruhland @ 2001-02-04 19:22 UTC (permalink / raw)
To: Steve Clarke; +Cc: linuxppc-embedded
On Sunday 04 February 2001 13:49, Paul Ruhland wrote:
> Steve,
>
> I will send you the changes for the MBX860 in another reply tomorrow (
> 20010205 ). All of that code is presently on my work machine.
>
I managed to find an a patch for the pcmcia-cs-3.1.22 I made for the mbx. I
only have code for the 'voltage_set' function in this patch. You should be
able to use this as a starting point for changes to pcmcia-cs-3.1.24...this
was done hastily and the hardware_enable, hardware_disable should probably be
implemented and the voltage_set could use some work. I believe this got it
up and running...I was able to use a 3Com LAN card ( 3c589_cs driver ).
Also, this patch doesn't include the irq stuff I mention in my previous reply.
I then abandoned the MBX in favor of an STK/TQM850L board from Denx Software
Engineering/TQ Components ( http://www.denx.de ) for various reasons.
For embedded mpc8xx development, I strongly recommend the STK/TQM boards and
PPCBOOT bootloader/monitor..outstanding hardware, software, support, and
documentation.
-------------------------------
Paul Ruhland
Micrwave Data Systems Inc.
175 Science Parkway
Rochester, NY 14620
TEL: +1.716.242.8372
EMAIL: pruhland@microwavedata.com
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: PCMCIA on MBX860
2001-02-04 19:22 ` Paul Ruhland
@ 2001-02-04 19:27 ` Paul Ruhland
0 siblings, 0 replies; 4+ messages in thread
From: Paul Ruhland @ 2001-02-04 19:27 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 736 bytes --]
On Sunday 04 February 2001 14:22, Paul Ruhland wrote:
> On Sunday 04 February 2001 13:49, Paul Ruhland wrote:
> > Steve,
> >
> > I will send you the changes for the MBX860 in another reply tomorrow (
> > 20010205 ). All of that code is presently on my work machine.
>
> I managed to find an a patch for the pcmcia-cs-3.1.22 I made for the mbx...
I guess attaching the patch would have been a good idea...I need email
software that automatically attaches files I'm referring to...hahaha.
Don't forget to modify the config.in stuff to match your development layout.
-------------------------------
Paul Ruhland
Micrwave Data Systems Inc.
175 Science Parkway
Rochester, NY 14620
TEL: +1.716.242.8372
EMAIL: pruhland@microwavedata.com
[-- Attachment #2: pcmcia-cs-3.1.22.mbx.patch --]
[-- Type: text/plain, Size: 4148 bytes --]
Only in pcmcia-cs-3.1.22: .prereq.ok
diff -c --recursive tar/pcmcia-cs-3.1.22/Configure pcmcia-cs-3.1.22/Configure
*** tar/pcmcia-cs-3.1.22/Configure Wed Nov 8 00:00:37 2000
--- pcmcia-cs-3.1.22/Configure Fri Dec 8 14:24:37 2000
***************
*** 433,438 ****
--- 433,439 ----
printflag "MPC8xx architecture" CONFIG_8xx
printflag "Embedded Planet LITE platform" CONFIG_RPXLITE
printflag "Embedded Planet CLASSIC platfom" CONFIG_RPXCLASSIC
+ printflag "Motorola MBX platform" CONFIG_MBX
printflag "MPC823 processor" CONFIG_MPC823
printflag "MPC850 processor" CONFIG_MPC850
printflag "MPC860 processor" CONFIG_MPC860
***************
*** 573,578 ****
--- 574,580 ----
configcheck CONFIG_8xx
configcheck CONFIG_RPXLITE
configcheck CONFIG_RPXCLASSIC
+ configcheck CONFIG_MBX
configcheck CONFIG_MPC823
configcheck CONFIG_MPC850
configcheck CONFIG_MPC860
diff -c --recursive tar/pcmcia-cs-3.1.22/config.in pcmcia-cs-3.1.22/config.in
*** tar/pcmcia-cs-3.1.22/config.in Thu Jun 15 23:23:48 2000
--- pcmcia-cs-3.1.22/config.in Fri Dec 8 14:03:14 2000
***************
*** 1,17 ****
#
# config.in 1.16 2000/06/15 18:23:48 (David Hinds)
#
! LINUX=/usr/src/linux
! PREFIX=
! MODDIR=
! CC=cc
! LD=ld
PCDEBUG=
KFLAGS=
UFLAGS=
! ARCH=
UNSAFE_TOOLS=n
! CONFIG_CARDBUS=y
CONFIG_PNP=n
USE_PM=y
CONF_SRC=1
--- 1,17 ----
#
# config.in 1.16 2000/06/15 18:23:48 (David Hinds)
#
! LINUX=/home/paulr/projects/nethop/linux
! PREFIX=/home/paulr/projects/nethop/target
! MODDIR=/lib/modules/2.2.14
! CC=ppc_8xx-gcc
! LD=ppc_8xx-ld
PCDEBUG=
KFLAGS=
UFLAGS=
! ARCH=ppc
UNSAFE_TOOLS=n
! CONFIG_CARDBUS=n
CONFIG_PNP=n
USE_PM=y
CONF_SRC=1
diff -c --recursive tar/pcmcia-cs-3.1.22/modules/m8xx_pcmcia.c pcmcia-cs-3.1.22/modules/m8xx_pcmcia.c
*** tar/pcmcia-cs-3.1.22/modules/m8xx_pcmcia.c Wed Oct 25 05:15:51 2000
--- pcmcia-cs-3.1.22/modules/m8xx_pcmcia.c Mon Dec 11 10:44:36 2000
***************
*** 94,99 ****
--- 94,105 ----
#endif
#endif
+ /* The MBX uses SLOT_A */
+ #ifdef CONFIG_MBX
+ #define CONFIG_PCMCIA_SLOT_A
+ #define CONFIG_BD_IS_HZ
+ #endif
+
#endif /* !defined(CONFIG_PCMCIA_SLOT_A) && !defined(CONFIG_PCMCIA_SLOT_B) */
/* ------------------------------------------------------------------------- */
***************
*** 138,146 ****
#endif
#ifdef CONFIG_BD_IS_MHZ
! #define M8XX_BUSFREQ ((mpc8xx_bdinfo->bi_busfreq) * 1000000)
#else
! #define M8XX_BUSFREQ (mpc8xx_bdinfo->bi_busfreq)
#endif
static int pcmcia_schlvl = PCMCIA_SCHLVL;
--- 144,154 ----
#endif
#ifdef CONFIG_BD_IS_MHZ
! //#define M8XX_BUSFREQ ((mpc8xx_bdinfo->bi_busfreq) * 1000000)
! #define M8XX_BUSFREQ ((50) * 1000000)
#else
! //#define M8XX_BUSFREQ (mpc8xx_bdinfo->bi_busfreq)
! #define M8XX_BUSFREQ ((50) * 1000000)
#endif
static int pcmcia_schlvl = PCMCIA_SCHLVL;
***************
*** 396,401 ****
--- 404,461 ----
}
#endif
+
+ /* --------------------------------------------------------------------------*/
+ /* MBX Boards from Motorola */
+
+ #if defined(CONFIG_MBX)
+
+ #define PCMCIA_BOARD_MSG "MBX860"
+
+ static int voltage_set(int slot, int vcc, int vpp)
+ {
+ unsigned char reg = 0;
+
+ switch(vcc) {
+ case 0: break;
+ case 33: reg |= 0x80; break;
+ case 50: reg |= 0x40; break;
+ default: return 1;
+ }
+
+ switch(vpp) {
+ case 0: break;
+ case 33:
+ case 50:
+ if(vcc == vpp)
+ reg |= 0x20;
+ else
+ return 1;
+ break;
+ case 120:
+ reg |= 0x10;
+ default: return 1;
+ }
+
+ if(!((vcc == 50) || (vcc == 0)))
+ return 1;
+
+ /* first, turn off all power */
+
+ *((unsigned char*)(MBX_CSR_ADDR + 1)) &= ~(0x80 | 0x40 | 0x20 | 0x10 );
+
+ /* enable new powersettings */
+
+ *((unsigned char*)(MBX_CSR_ADDR + 1)) |= reg;
+
+ return 0;
+ }
+
+ #define socket_get(_slot_) PCMCIA_SOCKET_KEY_5V
+ #define hardware_enable(_slot_) /* No hardware to enable */
+ #define hardware_disable(_slot_) /* No hardware to disable */
+
+ #endif /* CONFIG_MBX */
/* ------------------------------------------------------------------------- */
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2001-02-04 19:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-02-03 18:34 PCMCIA on MBX860 Steve Clarke
2001-02-04 18:49 ` Paul Ruhland
2001-02-04 19:22 ` Paul Ruhland
2001-02-04 19:27 ` Paul Ruhland
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).