ARM: at91: resurrect mach-at91/include/mach/io.h
PATCH 1/1 ARM: at91: resurrect mach-at91/include/mach/io.h
From: Joachim Eastwood <[email protected]>
Commmit 4d5fc58dbe34b78 "ARM: remove bunch of now unused mach/io.h files" removed the at91 io.h header. This makes pata_pcmcia when used with at91_cf fail on ioport_map in pcmcia_init_one.
Adding io.h and NEED_MACH_IO_H makes my CF card work again.
---
If there is better/correct way to solve the problem please disregard this patch.
arch/arm/mach-at91/Kconfig | 1 + arch/arm/mach-at91/include/mach/io.h | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 arch/arm/mach-at91/include/mach/io.h
arch/arm/mach-at91/Kconfig +1 -0
@@ -37,6 +37,7 @@ config ARCH_AT91RM9200 select GENERIC_CLOCKEVENTS select HAVE_AT91_DBGU0 select HAVE_AT91_USART3 + select NEED_MACH_IO_H config ARCH_AT91SAM9260 bool "AT91SAM9260 or AT91SAM9XE"
arch/arm/mach-at91/include/mach/io.h new file +32 -0
@@ -0,0 +1,32 @@ +/* +* arch/arm/mach-at91/include/mach/io.h +* +* Copyright (C) 2003 SAN People +* +* 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 +*/ + +#ifndef __ASM_ARCH_IO_H +#define __ASM_ARCH_IO_H + +#include <mach/hardware.h> + +#define IO_SPACE_LIMIT 0xFFFFFFFF + +#define __io (a) __typesafe_io(a) +#define __mem_pci (a) (a) + +#endif +
Signature · 1 line
1.7.9.2
PATCH 1/1 ARM: at91: resurrect mach-at91/include/mach/io.h
Quoted 6 lines · manabian at gmail.com
From: Joachim Eastwood <[email protected]>
Commmit
4d5fc58dbe34b78"ARM: remove bunch of now unusedmach/io.hfiles" removed the at91io.hheader. This makespata_pcmciawhen used withat91_cffail onioport_mapinpcmcia_init_one.
Quoted 7 lines
Adding
io.handNEED_MACH_IO_Hmakes my CF card work again.Signed-off-by Joachim Eastwood <[email protected]>---
If there is better/correct way to solve the problem please disregard this patch.
There is but it's not planned for 3.4. This fix is fine for 3.4 with one comment below.
The real solution involves creating a fixed i/o virtual address for all ARM platforms. Some testing to verify would help me. The following steps are needed:
Create a static mapping for your i/o region (up to 1MB) at virtual address 0xfef00000. The phys addr for this would be what cf->phys_baseaddr + CF_IO_PHYS works out to. Then define __io to this:
#define __io(x) (0xfef00000 + ((x) & 0xfffff))
The i/o address needs to be an offset from the i/o base. I think this line is wrong (but works with old __io definition) and needs to be removed from at91_cf.c:
/* pcmcia layer only remaps "real" memory not iospace */ cf->socket.io_offset = (unsigned long) ioremap(cf->phys_baseaddr + CF_IO_PHYS, SZ_2K);
Quoted 43 lines
arch/arm/mach-at91/Kconfig | 1 + arch/arm/mach-at91/include/mach/io.h | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 arch/arm/mach-at91/include/mach/io.harch/arm/mach-at91/Kconfig +1
-0@@ -37,6 +37,7 @@ config ARCH_AT91RM9200 select GENERIC_CLOCKEVENTS select HAVE_AT91_DBGU0 select HAVE_AT91_USART3 + select NEED_MACH_IO_H config ARCH_AT91SAM9260 bool "AT91SAM9260 or AT91SAM9XE"arch/arm/mach-at91/include/mach/io.h new file +19
-0@@ -0,0 +1,32 @@ +/* +* arch/arm/mach-at91/include/mach/io.h +* +* Copyright (C) 2003 SAN People +* +* 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 +*/
arch/arm/mach-at91/include/mach/io.h line 29
Quoted 10 lines
arch/arm/mach-at91/include/mach/io.h new file +10
-0+ +#ifndef __ASM_ARCH_IO_H +#define __ASM_ARCH_IO_H + +#include <mach/hardware.h> + +#define IO_SPACE_LIMIT 0xFFFFFFFF + +#define __io (a) __typesafe_io(a) +#define __mem_pci (a) (a)
__mem_pci is removed now.
Rob
Quoted 3 lines
arch/arm/mach-at91/include/mach/io.h new file +3
-0+ +#endif +