Commit f787fee2 authored by Deepak Saxena's avatar Deepak Saxena

[ARM] IXP2000 cleanups to get code upstream

This changeset fixes up all the IXP2000 issues mentioned in the following message:

http://lists.arm.linux.org.uk/pipermail/linux-arm-kernel/2004-August/024156.html

- Remove page table fixups for IXP2400 systems.  There is actually some
  confusion b/w myself and Intel on what mappings really needs this and
  we still need to determine a proper clean way to do this. When we have
  that, we'll add support back in. For now I am still able to boot 
  on IXP2400 systems.

- Replaced __asm__ __volatile__("":::"memory") with barrier()

- Remove inclusion of mach-types.h in ixdp2x01.h. The machine_is_ixdp2x01()
  macro was only being used in one place, so just check for 
  (machine_is_ixdp2401() || machine_is_ixdp2801())
Signed-off-by: default avatarDeepak Saxena <dsaxena@plexity.net>
parent 90a079b3
...@@ -162,48 +162,6 @@ void __init ixp2000_map_io(void) ...@@ -162,48 +162,6 @@ void __init ixp2000_map_io(void)
iotable_init(ixp2000_small_io_desc, ARRAY_SIZE(ixp2000_small_io_desc)); iotable_init(ixp2000_small_io_desc, ARRAY_SIZE(ixp2000_small_io_desc));
iotable_init(ixp2000_large_io_desc, ARRAY_SIZE(ixp2000_large_io_desc)); iotable_init(ixp2000_large_io_desc, ARRAY_SIZE(ixp2000_large_io_desc));
early_serial_setup(&ixp2000_serial_port); early_serial_setup(&ixp2000_serial_port);
#if defined(CONFIG_ARCH_IXDP2400) || defined (CONFIG_ARCH_IXDP2401)
/*
* Fixup up page table entries to deal with IXP2400 errata
* We first fix the small (page size) mappings and
* then the large (section size) ones.
*/
if (machine_is_ixdp2400() | machine_is_ixdp2401()) {
pmd_t *pmdp;
pte_t *ptep;
u32 virt, virt_end;
int i;
for (i = 0; i < ARRAY_SIZE(ixp2000_small_io_desc); i++) {
virt = ixp2000_small_io_desc[i].virtual;
virt_end = virt + ixp2000_small_io_desc[i].length;
do {
pmdp = pmd_offset(pgd_offset_k(virt), virt);
ptep = pte_offset_kernel(pmdp, virt);
set_pte(ptep, (pte_val(*ptep) | PTE_EXT_TEX(1) | L_PTE_BUFFERABLE));
virt += PAGE_SIZE;
} while (virt < virt_end);
}
for (i = 0; i < ARRAY_SIZE(ixp2000_large_io_desc); i++) {
virt = ixp2000_large_io_desc[i].virtual;
virt_end = virt + ixp2000_large_io_desc[i].length;
do {
pmdp = pmd_offset(pgd_offset_k(virt), virt);
set_pmd(pmdp, pmd_val(*pmdp) | (PMD_SECT_TEX(1) | PMD_SECT_BUFFERABLE));
virt += 0x100000;
} while (virt < virt_end);
}
}
#endif
} }
/************************************************************************* /*************************************************************************
......
...@@ -65,6 +65,8 @@ ...@@ -65,6 +65,8 @@
#undef insw #undef insw
#undef outsw #undef outsw
#include <asm/mach-types.h>
static inline void insw(u32 ptr, void *buf, int length) static inline void insw(u32 ptr, void *buf, int length)
{ {
register volatile u32 *port = (volatile u32 *)ptr; register volatile u32 *port = (volatile u32 *)ptr;
...@@ -72,7 +74,7 @@ static inline void insw(u32 ptr, void *buf, int length) ...@@ -72,7 +74,7 @@ static inline void insw(u32 ptr, void *buf, int length)
/* /*
* Is this cycle meant for the CS8900? * Is this cycle meant for the CS8900?
*/ */
if (machine_is_ixdp2x01() && if ((machine_is_ixdp2401() || machine_is_ixdp2801()) &&
((port >= IXDP2X01_CS8900_VIRT_BASE) && ((port >= IXDP2X01_CS8900_VIRT_BASE) &&
(port <= IXDP2X01_CS8900_VIRT_END))) { (port <= IXDP2X01_CS8900_VIRT_END))) {
u8 *buf8 = (u8*)buf; u8 *buf8 = (u8*)buf;
...@@ -97,7 +99,7 @@ static inline void outsw(u32 ptr, void *buf, int length) ...@@ -97,7 +99,7 @@ static inline void outsw(u32 ptr, void *buf, int length)
/* /*
* Is this cycle meant for the CS8900? * Is this cycle meant for the CS8900?
*/ */
if (machine_is_ixdp2x01() && if ((machine_is_ixdp2401() || machine_is_ixdp2801()) &&
((port >= IXDP2X01_CS8900_VIRT_BASE) && ((port >= IXDP2X01_CS8900_VIRT_BASE) &&
(port <= IXDP2X01_CS8900_VIRT_END))) { (port <= IXDP2X01_CS8900_VIRT_END))) {
register u32 tmp32; register u32 tmp32;
...@@ -121,7 +123,7 @@ static inline u16 inw(u32 ptr) ...@@ -121,7 +123,7 @@ static inline u16 inw(u32 ptr)
/* /*
* Is this cycle meant for the CS8900? * Is this cycle meant for the CS8900?
*/ */
if (machine_is_ixdp2x01() && if ((machine_is_ixdp2401() || machine_is_ixdp2801()) &&
((port >= IXDP2X01_CS8900_VIRT_BASE) && ((port >= IXDP2X01_CS8900_VIRT_BASE) &&
(port <= IXDP2X01_CS8900_VIRT_END))) { (port <= IXDP2X01_CS8900_VIRT_END))) {
return (u16)(*port); return (u16)(*port);
...@@ -134,7 +136,7 @@ static inline void outw(u16 value, u32 ptr) ...@@ -134,7 +136,7 @@ static inline void outw(u16 value, u32 ptr)
{ {
register volatile u32 *port = (volatile u32 *)ptr; register volatile u32 *port = (volatile u32 *)ptr;
if (machine_is_ixdp2x01() && if ((machine_is_ixdp2401() || machine_is_ixdp2801()) &&
((port >= IXDP2X01_CS8900_VIRT_BASE) && ((port >= IXDP2X01_CS8900_VIRT_BASE) &&
(port <= IXDP2X01_CS8900_VIRT_END))) { (port <= IXDP2X01_CS8900_VIRT_END))) {
*port = value; *port = value;
......
...@@ -50,10 +50,4 @@ ...@@ -50,10 +50,4 @@
#define IXDP2X01_UART_CLK 1843200 #define IXDP2X01_UART_CLK 1843200
#ifndef __ASSEMBLY__
#include <asm/mach-types.h>
#define machine_is_ixdp2x01() (machine_is_ixdp2401() || \
machine_is_ixdp2801())
#endif
#endif /* __IXDP2x01_H__ */ #endif /* __IXDP2x01_H__ */
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
/* /*
* The IXP2400B0 silicon contains an errata that causes writes to * The IXP2400 B0 silicon contains an errata that causes writes to
* on-chip I/O register to not complete fully. What this means is * on-chip I/O register to not complete fully. What this means is
* that if you have a write to on-chip I/O followed by a back-to-back * that if you have a write to on-chip I/O followed by a back-to-back
* read or write, the first write will happend twice. OR...if it's * read or write, the first write will happend twice. OR...if it's
...@@ -38,7 +38,7 @@ static inline void ixp2000_reg_write(volatile unsigned long *reg, unsigned long ...@@ -38,7 +38,7 @@ static inline void ixp2000_reg_write(volatile unsigned long *reg, unsigned long
local_irq_save(flags); local_irq_save(flags);
*reg = val; *reg = val;
__asm__ __volatile__("":::"memory"); barrier();
dummy = *reg; dummy = *reg;
local_irq_restore(flags); local_irq_restore(flags);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment