diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-01-27 01:05:20 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-01-27 01:05:20 +0000 |
commit | 546db14ee74118296f425f3b91634fb767d67290 (patch) | |
tree | 22b613a3da8d4bf663eec5e155af01b87fdf9094 /include/asm-arm/arch-rpc | |
parent | 1e25e41c4f5474e14452094492dbc169b800e4c8 (diff) |
Merge with Linux 2.3.23. The new bootmem stuff has broken various
platforms. At this time I've only verified that IP22 support compiles
and IP27 actually works.
Diffstat (limited to 'include/asm-arm/arch-rpc')
-rw-r--r-- | include/asm-arm/arch-rpc/a.out.h | 16 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/acornfb.h | 99 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/hardware.h | 14 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/irq.h | 2 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/memory.h | 9 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/mm-init.h | 47 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/param.h | 5 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/processor.h | 2 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/shmparam.h | 5 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/system.h | 33 |
10 files changed, 136 insertions, 96 deletions
diff --git a/include/asm-arm/arch-rpc/a.out.h b/include/asm-arm/arch-rpc/a.out.h deleted file mode 100644 index 56b2f4f7a..000000000 --- a/include/asm-arm/arch-rpc/a.out.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * linux/include/asm-arm/arch-rpc/a.out.h - * - * Copyright (C) 1996-1999 Russell King - */ -#ifndef __ASM_ARCH_A_OUT_H -#define __ASM_ARCH_A_OUT_H - -#include <asm/arch/memory.h> - -#define STACK_TOP \ - ((current->personality == PER_LINUX_32BIT) ? \ - TASK_SIZE : 0x04000000) - -#endif - diff --git a/include/asm-arm/arch-rpc/acornfb.h b/include/asm-arm/arch-rpc/acornfb.h new file mode 100644 index 000000000..531481215 --- /dev/null +++ b/include/asm-arm/arch-rpc/acornfb.h @@ -0,0 +1,99 @@ +/* + * linux/include/asm-arm/arch-rpc/acornfb.h + * + * (C) 1999 Russell King + * + * AcornFB architecture specific code + */ + +#define acornfb_valid_pixrate(rate) (1) + +/* + * Try to find the best PLL parameters for the pixel clock. + * This algorithm seems to give best predictable results, + * and produces the same values as detailed in the VIDC20 + * data sheet. + */ +static inline u_int +acornfb_vidc20_find_pll(u_int pixclk) +{ + u_int r, best_r = 2, best_v = 2; + int best_d = 0x7fffffff; + + for (r = 2; r <= 32; r++) { + u_int rr, v, p; + int d; + + rr = 41667 * r; + + v = (rr + pixclk / 2) / pixclk; + + if (v > 32 || v < 2) + continue; + + p = (rr + v / 2) / v; + + d = pixclk - p; + + if (d < 0) + d = -d; + + if (d < best_d) { + best_d = d; + best_v = v - 1; + best_r = r - 1; + } + + if (d == 0) + break; + } + + return best_v << 8 | best_r; +} + +static inline void +acornfb_vidc20_find_rates(struct vidc_timing *vidc, + struct fb_var_screeninfo *var) +{ + u_int div, bandwidth; + + /* Select pixel-clock divisor to keep PLL in range */ + div = var->pixclock / 9090; /*9921*/ + + /* Limit divisor */ + if (div == 0) + div = 1; + if (div > 8) + div = 8; + + /* Encode divisor to VIDC20 setting */ + switch (div) { + case 1: vidc->control |= VIDC20_CTRL_PIX_CK; break; + case 2: vidc->control |= VIDC20_CTRL_PIX_CK2; break; + case 3: vidc->control |= VIDC20_CTRL_PIX_CK3; break; + case 4: vidc->control |= VIDC20_CTRL_PIX_CK4; break; + case 5: vidc->control |= VIDC20_CTRL_PIX_CK5; break; + case 6: vidc->control |= VIDC20_CTRL_PIX_CK6; break; + case 7: vidc->control |= VIDC20_CTRL_PIX_CK7; break; + case 8: vidc->control |= VIDC20_CTRL_PIX_CK8; break; + } + + /* Calculate bandwidth */ + bandwidth = var->pixclock * 8 / var->bits_per_pixel; + + /* Encode bandwidth as VIDC20 setting */ + if (bandwidth > 33334) + vidc->control |= VIDC20_CTRL_FIFO_16; /* < 30.0MB/s */ + else if (bandwidth > 26666) + vidc->control |= VIDC20_CTRL_FIFO_20; /* < 37.5MB/s */ + else if (bandwidth > 22222) + vidc->control |= VIDC20_CTRL_FIFO_24; /* < 45.0MB/s */ + else + vidc->control |= VIDC20_CTRL_FIFO_28; /* > 45.0MB/s */ + + /* Find the PLL values */ + vidc->pll_ctl = acornfb_vidc20_find_pll(var->pixclock / div); +} + +#define acornfb_default_control() (VIDC20_CTRL_PIX_VCLK) +#define acornfb_default_econtrol() (VIDC20_ECTL_DAC | VIDC20_ECTL_REG(3)) diff --git a/include/asm-arm/arch-rpc/hardware.h b/include/asm-arm/arch-rpc/hardware.h index 0e3002f85..0ae320b86 100644 --- a/include/asm-arm/arch-rpc/hardware.h +++ b/include/asm-arm/arch-rpc/hardware.h @@ -41,7 +41,7 @@ #define FLUSH_BASE 0xdf000000 -#ifndef __ASSEMBLER__ +#ifndef __ASSEMBLY__ /* * for use with inb/outb @@ -93,5 +93,17 @@ #define PCIO_BASE 0xe0010000 #endif + +#ifdef HAS_EXPMASK +#ifndef __ASSEMBLY__ +#define __EXPMASK(offset) (((volatile unsigned char *)EXPMASK_BASE)[offset]) +#else +#define __EXPMASK(offset) offset +#endif + +#define EXPMASK_STATUS __EXPMASK(0x00) +#define EXPMASK_ENABLE __EXPMASK(0x04) + #endif +#endif diff --git a/include/asm-arm/arch-rpc/irq.h b/include/asm-arm/arch-rpc/irq.h index ea284b9a5..c7d98b0c0 100644 --- a/include/asm-arm/arch-rpc/irq.h +++ b/include/asm-arm/arch-rpc/irq.h @@ -174,4 +174,6 @@ static __inline__ void irq_init_irq(void) break; } } + + init_FIQ(); } diff --git a/include/asm-arm/arch-rpc/memory.h b/include/asm-arm/arch-rpc/memory.h index 6922cd0f3..d5a6a4f9f 100644 --- a/include/asm-arm/arch-rpc/memory.h +++ b/include/asm-arm/arch-rpc/memory.h @@ -18,16 +18,17 @@ * Task size: 3GB */ #define TASK_SIZE (0xc0000000UL) +#define TASK_SIZE_26 (0x04000000UL) /* * Page offset: 3GB */ #define PAGE_OFFSET (0xc0000000UL) -#ifndef __ASSEMBLY__ -extern unsigned long __virt_to_phys(unsigned long vpage); -extern unsigned long __phys_to_virt(unsigned long ppage); -#endif +#define __virt_to_phys__is_a_macro +#define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET + 0x10000000) +#define __phys_to_virt__is_a_macro +#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET - 0x10000000) /* * These are exactly the same on the RiscPC as the diff --git a/include/asm-arm/arch-rpc/mm-init.h b/include/asm-arm/arch-rpc/mm-init.h deleted file mode 100644 index 81de91a01..000000000 --- a/include/asm-arm/arch-rpc/mm-init.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * linux/include/asm-arm/arch-rpc/mmap.h - * - * Copyright (C) 1996 Russell King - */ - -#define HAVE_MAP_VID_MEM - -unsigned long map_screen_mem(unsigned long log_start, unsigned long kmem, int update) -{ - static int updated = 0; - unsigned long address; - pgd_t *pgd; - - if (updated) - return 0; - updated = update; - - address = SCREEN_START | PMD_TYPE_SECT | PMD_DOMAIN(DOMAIN_KERNEL) | PMD_SECT_AP_WRITE; - pgd = swapper_pg_dir + (SCREEN2_BASE >> PGDIR_SHIFT); - pgd_val(pgd[0]) = address; - pgd_val(pgd[1]) = address + (1 << PGDIR_SHIFT); - - if (update) { - unsigned long pgtable = PAGE_ALIGN(kmem), *p; - int i; - - memzero ((void *)pgtable, 4096); - - pgd_val(pgd[-2]) = __virt_to_phys(pgtable) | PMD_TYPE_TABLE | PMD_DOMAIN(DOMAIN_KERNEL); - pgd_val(pgd[-1]) = __virt_to_phys(pgtable + PTRS_PER_PTE*4) | PMD_TYPE_TABLE | PMD_DOMAIN(DOMAIN_KERNEL); - p = (unsigned long *)pgtable; - - i = PTRS_PER_PTE * 2 - ((SCREEN1_END - log_start) >> PAGE_SHIFT); - address = SCREEN_START | PTE_TYPE_SMALL | PTE_AP_WRITE; - - while (i < PTRS_PER_PTE * 2) { - p[i++] = address; - address += PAGE_SIZE; - } - - flush_page_to_ram(pgtable); - - kmem = pgtable + PAGE_SIZE; - } - return kmem; -} diff --git a/include/asm-arm/arch-rpc/param.h b/include/asm-arm/arch-rpc/param.h index c71625c93..4ac90b86b 100644 --- a/include/asm-arm/arch-rpc/param.h +++ b/include/asm-arm/arch-rpc/param.h @@ -1,9 +1,4 @@ /* * linux/include/asm-arm/arch-rpc/param.h - * - * Copyright (C) 1996 Russell King - * Copyright (C) 1998 Philip Blundell */ - -#define HZ 100 #define HZ_TO_STD(a) (a) diff --git a/include/asm-arm/arch-rpc/processor.h b/include/asm-arm/arch-rpc/processor.h index b2b6aec12..fd9aa088d 100644 --- a/include/asm-arm/arch-rpc/processor.h +++ b/include/asm-arm/arch-rpc/processor.h @@ -11,8 +11,6 @@ #ifndef __ASM_ARCH_PROCESSOR_H #define __ASM_ARCH_PROCESSOR_H -#include <asm/arch/memory.h> - /* * Bus types */ diff --git a/include/asm-arm/arch-rpc/shmparam.h b/include/asm-arm/arch-rpc/shmparam.h deleted file mode 100644 index 2f7dec9c3..000000000 --- a/include/asm-arm/arch-rpc/shmparam.h +++ /dev/null @@ -1,5 +0,0 @@ -/* - * linux/include/asm-arm/arch-rpc/shmparam.h - * - * Copyright (c) 1996 Russell King. - */ diff --git a/include/asm-arm/arch-rpc/system.h b/include/asm-arm/arch-rpc/system.h index a4b92939e..af4ebc348 100644 --- a/include/asm-arm/arch-rpc/system.h +++ b/include/asm-arm/arch-rpc/system.h @@ -1,23 +1,24 @@ /* * linux/include/asm-arm/arch-rpc/system.h * - * Copyright (c) 1996 Russell King + * Copyright (c) 1996-1999 Russell King. */ -#ifndef __ASM_ARCH_SYSTEM_H -#define __ASM_ARCH_SYSTEM_H - +#include <asm/arch/hardware.h> #include <asm/iomd.h> +#include <asm/io.h> + +#define arch_do_idle() cpu_do_idle() + +extern __inline__ void arch_reset(char mode) +{ + extern void ecard_reset(int card); + + ecard_reset(-1); -#define arch_reset(mode) { \ - extern void ecard_reset (int card); \ - outb (0, IOMD_ROMCR0); \ - ecard_reset(-1); \ - cli(); \ - __asm__ __volatile__("msr spsr, r1;" \ - "mcr p15, 0, %0, c1, c0, 0;" \ - "movs pc, #0" \ - : \ - : "r" (cpu_reset())); \ - } + outb(0, IOMD_ROMCR0); -#endif + __asm__ __volatile__( + "mcr p15, 0, %0, c1, c0, 0\n\t" + "movs pc, #0" + : : "r" (cpu_reset())); +} |