diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2005-01-14 18:44:09 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2005-01-14 18:44:09 +0000 |
commit | d35ef60cb7f052fcbf6b9bf84dba1d7c79984186 (patch) | |
tree | 9b21a04846a74d601c13189e71b7c83ac689ecc9 | |
parent | 2a4978b5f711b76f0094491b46f71eefdea119ae (diff) |
Lubbock scrubbing.
-rw-r--r-- | sys/arch/zaurus/include/zaurus_reg.h | 58 | ||||
-rw-r--r-- | sys/arch/zaurus/include/zaurus_var.h | 67 | ||||
-rw-r--r-- | sys/arch/zaurus/zaurus/zaurus_machdep.c | 133 |
3 files changed, 43 insertions, 215 deletions
diff --git a/sys/arch/zaurus/include/zaurus_reg.h b/sys/arch/zaurus/include/zaurus_reg.h index b5ef7c99308..e613d2e3b46 100644 --- a/sys/arch/zaurus/include/zaurus_reg.h +++ b/sys/arch/zaurus/include/zaurus_reg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: zaurus_reg.h,v 1.2 2005/01/02 19:43:07 drahn Exp $ */ +/* $OpenBSD: zaurus_reg.h,v 1.3 2005/01/14 18:44:08 drahn Exp $ */ /* $NetBSD: lubbock_reg.h,v 1.1 2003/06/18 10:51:15 bsh Exp $ */ /* @@ -31,60 +31,34 @@ */ -#ifndef _EVBARM_LUBBOCK_REG_H -#define _EVBARM_LUBBOCK_REG_H +#ifndef _EVBARM_ZAURUS_REG_H +#define _EVBARM_ZAURUS_REG_H #include <arm/xscale/pxa2x0reg.h> -/* lubbock on-board IOs */ -#define LUBBOCK_OBIO_PBASE PXA2X0_CS2_START /* Physical address */ -#define LUBBOCK_OBIO_SIZE 0x00000100 +#define ZAURUS_SRAM_PBASE (PXA2X0_CS2_START+0x02000000) +#define ZAURUS_SRAM_SIZE 0x00100000 -#define LUBBOCK_SRAM_PBASE (PXA2X0_CS2_START+0x02000000) -#define LUBBOCK_SRAM_SIZE 0x00100000 - -#define LUBBOCK_91C96_PBASE PXA2X0_CS3_START -#define LUBBOCK_91C96_IO LUBBOCK_91C96_PBASE -#define LUBBOCK_91C96_ATTRMEM (LUBBOCK_91C96_PBASE+0x02000000) +#define ZAURUS_91C96_PBASE PXA2X0_CS3_START +#define ZAURUS_91C96_IO ZAURUS_91C96_PBASE +#define ZAURUS_91C96_ATTRMEM (ZAURUS_91C96_PBASE+0x02000000) /* SA-1111 companion chip registers */ -#define LUBBOCK_SACC_PBASE PXA2X0_CS4_START +#define ZAURUS_SACC_PBASE PXA2X0_CS4_START /* * Logical mapping for onboard/integrated peripherals */ -#define LUBBOCK_IO_AREA_VBASE 0xfd000000 -#define LUBBOCK_OBIO_VBASE 0xfd000000 -#define LUBBOCK_GPIO_VBASE 0xfd100000 -#define LUBBOCK_CLKMAN_VBASE 0xfd200000 -#define LUBBOCK_INTCTL_VBASE 0xfd300000 -#define LUBBOCK_AGPIO_VBASE 0xfd400000 -#define LUBBOCK_VBASE_FREE 0xfd500000 +#define ZAURUS_IO_AREA_VBASE 0xfd000000 +#define ZAURUS_GPIO_VBASE 0xfd000000 +#define ZAURUS_CLKMAN_VBASE 0xfd100000 +#define ZAURUS_INTCTL_VBASE 0xfd200000 +#define ZAURUS_AGPIO_VBASE 0xfd300000 +#define ZAURUS_VBASE_FREE 0xfd400000 /* FFUART and/or BTUART are mapped to this area when used for console or kgdb port */ -/* - * Onboard register address - * (offset from LUBBOCK_OBIO_PBASE) - */ -#define LUBBOCK_SYSTEMID 0x0000 -#define LUBBOCK_HEXLED 0x0010 -#define LUBBOCK_LEDCTL 0x0040 -#define LUBBOCK_CONFIGSW 0x0050 -#define LUBBOCK_USERSW 0x0060 -#define LUBBOCK_MISCWR 0x0080 -#define MISCWR_S1PWR (3U<<14) -#define MISCWR_LCDDISP (1U<<8) -#define MISCWR_IRDAMODE (1U<<4) /* 1=FIR, 0=SIR */ -#define MISCWR_GREENLED (1U<<3) -#define MISCWR_ENETEN16 (1U<<2) -#define MISCWR_PCRESET (1U<<1) /* Processor card reset */ -#define MSICWR_SYSRESET (1U<<0) -#define LUBBOCK_MISCRD 0x0090 -#define LUBBOCK_INTRMASK 0x00c0 -#define LUBBOCK_INTRCTL 0x00d0 - #define ioreg_read(a) (*(volatile unsigned *)(a)) #define ioreg_write(a,v) (*(volatile unsigned *)(a)=(v)) @@ -94,4 +68,4 @@ #define ioreg8_read(a) (*(volatile uint8_t *)(a)) #define ioreg8_write(a,v) (*(volatile uint8_t *)(a)=(v)) -#endif /* _EVBARM_LUBBOCK_REG_H */ +#endif /* _EVBARM_ZAURUS_REG_H */ diff --git a/sys/arch/zaurus/include/zaurus_var.h b/sys/arch/zaurus/include/zaurus_var.h index a9de2e7afb7..88f43d3ce81 100644 --- a/sys/arch/zaurus/include/zaurus_var.h +++ b/sys/arch/zaurus/include/zaurus_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: zaurus_var.h,v 1.2 2005/01/02 19:43:07 drahn Exp $ */ +/* $OpenBSD: zaurus_var.h,v 1.3 2005/01/14 18:44:08 drahn Exp $ */ /* $NetBSD: lubbock_var.h,v 1.1 2003/06/18 10:51:15 bsh Exp $ */ /* @@ -30,8 +30,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _EVBARM_LUBBOCK_VAR_H -#define _EVBARM_LUBBOCK_VAR_H +#ifndef _EVBARM_ZAURUS_VAR_H +#define _EVBARM_ZAURUS_VAR_H #include <sys/conf.h> #include <sys/device.h> @@ -39,63 +39,6 @@ #include <machine/bus.h> #include <machine/zaurus_reg.h> +/* XXX */ -/* - * Lubbock on-board IO bus - */ -#define N_OBIO_IRQ 8 - -struct obio_softc { - struct device sc_dev; - bus_space_tag_t sc_iot; - bus_space_handle_t sc_obioreg_ioh; - void *sc_ih; /* interrupt handler for obio on pxaip */ - void *sc_si; /* software interrupt handler */ - int sc_intr; - int sc_obio_intr_mask; - int sc_obio_intr_pending; - int sc_ipl; /* Max ipl among sub interrupts */ - struct obio_handler { - int (* func)(void *); - void *arg; - int level; - } sc_handler[N_OBIO_IRQ]; -}; - -typedef void *obio_chipset_tag_t; - -struct obio_attach_args { - obio_chipset_tag_t oba_sc; - bus_space_tag_t oba_iot; /* Bus tag */ - bus_addr_t oba_addr; /* i/o address */ - int oba_intr; -}; - -/* on-board hex LED */ -void hex_led_blank( uint32_t value, int blank ); -#define hex_led(value) ioreg_write( LUBBOCK_OBIO_VBASE+LUBBOCK_HEXLED, (value) ) -#define hex_led_p(value) ioreg_write( LUBBOCK_OBIO_PBASE+LUBBOCK_HEXLED, (value) ) - -#define d_led(value) ioreg16_write( LUBBOCK_OBIO_VBASE+LUBBOCK_LEDCTL, (value) ) - -/* - * IRQ handler - */ -void *obio_intr_establish(struct obio_softc *, int, int, int (*)(void *), void *); -void obio_intr_disestablish(void *); - -#define obio_read(offset) ioreg_read(LUBBOCK_OBIO_VBASE+(offset)) -#define obio_write(offset,value) \ - ioreg_write(LUBBOCK_OBIO_VBASE+(offset), (value)) - - -#define obio16_read(offset) ioreg16_read(LUBBOCK_OBIO_VBASE+(offset)) -#define obio16_write(offset,value) \ - ioreg16_write(LUBBOCK_OBIO_VBASE+(offset), (value)) - -#define obio8_read(offset) ioreg8_read(LUBBOCK_OBIO_VBASE+(offset)) -#define obio8_write(offset,value) \ - ioreg8_write(LUBBOCK_OBIO_VBASE+(offset), (value)) - - -#endif /* _EVBARM_LUBBOCK_VAR_H */ +#endif /* _EVBARM_ZAURUS_VAR_H */ diff --git a/sys/arch/zaurus/zaurus/zaurus_machdep.c b/sys/arch/zaurus/zaurus/zaurus_machdep.c index 3396c3d6f8f..90af88b1c97 100644 --- a/sys/arch/zaurus/zaurus/zaurus_machdep.c +++ b/sys/arch/zaurus/zaurus/zaurus_machdep.c @@ -417,37 +417,31 @@ struct l1_sec_map { int flags; } l1_sec_table[] = { { - LUBBOCK_OBIO_VBASE, - LUBBOCK_OBIO_PBASE, - LUBBOCK_OBIO_SIZE, - PTE_NOCACHE, - }, - { - LUBBOCK_GPIO_VBASE, + ZAURUS_GPIO_VBASE, PXA2X0_GPIO_BASE, PXA2X0_GPIO_SIZE, PTE_NOCACHE, }, { - LUBBOCK_CLKMAN_VBASE, + ZAURUS_CLKMAN_VBASE, PXA2X0_CLKMAN_BASE, PXA2X0_CLKMAN_SIZE, PTE_NOCACHE, }, { - LUBBOCK_INTCTL_VBASE, + ZAURUS_INTCTL_VBASE, PXA2X0_INTCTL_BASE, PXA2X0_INTCTL_SIZE, PTE_NOCACHE, }, { - LUBBOCK_INTCTL_VBASE, + ZAURUS_INTCTL_VBASE, PXA2X0_INTCTL_BASE, PXA2X0_INTCTL_SIZE, PTE_NOCACHE, }, { - LUBBOCK_AGPIO_VBASE, + ZAURUS_AGPIO_VBASE, 0x10800000, 0x00010000, /* XXX */ PTE_NOCACHE, @@ -487,7 +481,7 @@ map_io_area(paddr_t pagedir) * before pmap is initialized. * size and cacheability are ignored and map one section with nocache. */ -static vaddr_t section_free = LUBBOCK_VBASE_FREE; +static vaddr_t section_free = ZAURUS_VBASE_FREE; static int bootstrap_bs_map(void *t, bus_addr_t bpa, bus_size_t size, @@ -517,7 +511,7 @@ copy_io_area_map(pd_entry_t *new_pd) pd_entry_t *cur_pd = read_ttb(); vaddr_t va; - for (va = LUBBOCK_IO_AREA_VBASE; + for (va = ZAURUS_IO_AREA_VBASE; (cur_pd[va>>L1_S_SHIFT] & L1_TYPE_MASK) == L1_TYPE_S; va += L1_S_SIZE) { @@ -535,7 +529,7 @@ green_on(int virt) /* clobber green led p */ volatile u_int16_t *p; if (virt) - p = (u_int16_t *)(LUBBOCK_AGPIO_VBASE+0x24); + p = (u_int16_t *)(ZAURUS_AGPIO_VBASE+0x24); else p = (u_int16_t *)0x10800024; @@ -602,19 +596,9 @@ initarm(void *arg) struct bus_space tmp_bs_tag; int (*map_func_save)(void *, bus_addr_t, bus_size_t, int, bus_space_handle_t *); -#if 0 -#define LEDSTEP_P() ioreg_write(LUBBOCK_OBIO_PBASE+LUBBOCK_HEXLED, led_data++) -#define LEDSTEP() hex_led(led_data++) -#else -#define LEDSTEP_P() -#define LEDSTEP() -#endif - /* use physical address until pagetable is set */ - LEDSTEP_P(); - #if 0 /* XXX */ /* start 32.768KHz OSC */ @@ -626,7 +610,6 @@ initarm(void *arg) */ if (set_cpufuncs()) panic("cpu not recognized!"); - LEDSTEP_P(); /* Get ready for splfoo() */ pxa2x0_intr_bootstrap(PXA2X0_INTCTL_BASE); @@ -687,7 +670,7 @@ initarm(void *arg) } /* setup GPIO for BTUART, in case bootloader doesn't take care of it */ - pxa2x0_gpio_bootstrap(LUBBOCK_GPIO_VBASE); + pxa2x0_gpio_bootstrap(ZAURUS_GPIO_VBASE); #if 0 pxa2x0_gpio_set_function(42, GPIO_ALT_FN_1_IN); pxa2x0_gpio_set_function(43, GPIO_ALT_FN_2_OUT); @@ -705,27 +688,20 @@ initarm(void *arg) #if 1 /* turn on clock to UART block. XXX: this should not be done here. */ - ioreg_write(LUBBOCK_CLKMAN_VBASE+CLKMAN_CKEN, CKEN_FFUART|CKEN_BTUART | - ioreg_read(LUBBOCK_CLKMAN_VBASE+CLKMAN_CKEN)); + ioreg_write(ZAURUS_CLKMAN_VBASE+CLKMAN_CKEN, CKEN_FFUART|CKEN_BTUART | + ioreg_read(ZAURUS_CLKMAN_VBASE+CLKMAN_CKEN)); #endif green_on(0); - LEDSTEP(); - tmp_bs_tag = pxa2x0_bs_tag; tmp_bs_tag.bs_map = bootstrap_bs_map; map_func_save = pxa2x0_a4x_bs_tag.bs_map; pxa2x0_a4x_bs_tag.bs_map = bootstrap_bs_map; - LEDSTEP(); - - consinit(); - LEDSTEP(); #ifdef KGDB kgdb_port_init(); - LEDSTEP(); #endif @@ -759,8 +735,8 @@ initarm(void *arg) ioreg_write(PXA2X0_MEMCTL_BASE+MEMCTL_MECR, MECR_NOS|MECR_CIT); - tmp = ioreg_read(LUBBOCK_SACC_PBASE+SACCSBI_SKCR); - ioreg_write(LUBBOCK_SACC_PBASE+SACCSBI_SKCR, + tmp = ioreg_read(ZAURUS_SACC_PBASE+SACCSBI_SKCR); + ioreg_write(ZAURUS_SACC_PBASE+SACCSBI_SKCR, (tmp & ~(1<<4)) | (1<<0)); } @@ -779,27 +755,9 @@ initarm(void *arg) { - int processor_card_id; - - processor_card_id = 0x000f & - ioreg_read(LUBBOCK_OBIO_VBASE+LUBBOCK_MISCRD); - switch(processor_card_id){ - case 0: - /* Cotulla */ - memstart = 0xa0000000; - memsize = 0x02000000; /* 32MB -phone */ - memsize = 0x04000000; /* 64MB */ - break; - case 1: - /* XXX: Sabiani */ - memstart = 0xa0000000; - memsize = 0x04000000; /* 64MB */ - break; - default: - /* XXX: Unknown */ - memstart = 0xa0000000; - memsize = 0x04000000; /* 64MB */ - } + /* XXX - all Zaurus have this for now, fix memory sizing */ + memstart = 0xa0000000; + memsize = 0x04000000; /* 64MB */ } #if 0 @@ -925,8 +883,6 @@ initarm(void *arg) if (!kernel_l1pt.pv_pa || (kernel_l1pt.pv_pa & (L1_TABLE_SIZE-1)) != 0) panic("initarm: Failed to align the kernel page directory"); - LEDSTEP(); - /* * Allocate a page for the system page mapped to V0x00000000 * This page will just contain the system vectors and can be @@ -1098,19 +1054,14 @@ initarm(void *arg) printf("switching to new L1 page table @%#lx...", kernel_l1pt.pv_pa); #endif - LEDSTEP(); - /* set new intc register address so that splfoo() doesn't touch illegal address. */ - pxa2x0_intr_bootstrap(LUBBOCK_INTCTL_VBASE); - - LEDSTEP(); + pxa2x0_intr_bootstrap(ZAURUS_INTCTL_VBASE); cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT); setttb(kernel_l1pt.pv_pa); cpu_tlb_flushID(); cpu_domains(DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)); - LEDSTEP(); /* * Moved from cpu_startup() as data_abort_handler() references @@ -1188,29 +1139,13 @@ initarm(void *arg) #ifdef VERBOSE_INIT_ARM printf("pmap "); #endif - LEDSTEP(); pmap_bootstrap((pd_entry_t *)kernel_l1pt.pv_va, KERNEL_VM_BASE, KERNEL_VM_BASE + KERNEL_VM_SIZE); - LEDSTEP(); #ifdef __HAVE_MEMORY_DISK__ md_root_setconf(memory_disk, sizeof memory_disk); #endif -#if 0 - /* XXX - drahn */ - { - uint16_t sw = ioreg16_read(LUBBOCK_OBIO_VBASE+LUBBOCK_USERSW); - - if (0 == (sw & (1<<13))) /* check S19 */ - boothowto |= RB_KDB; - if (0 == (sw & (1<<12))) /* S20 */ - boothowto |= RB_SINGLE; - } -#endif - - LEDSTEP(); - #ifdef IPKDB /* Initialise ipkdb */ ipkdb_init(); @@ -1293,7 +1228,7 @@ void consinit(void) { static int consinit_called = 0; - uint32_t ckenreg = ioreg_read(LUBBOCK_CLKMAN_VBASE+CLKMAN_CKEN); + uint32_t ckenreg = ioreg_read(ZAURUS_CLKMAN_VBASE+CLKMAN_CKEN); #if 0 char *console = CONSDEVNAME; #endif @@ -1306,10 +1241,6 @@ consinit(void) #if NCOM > 0 #ifdef FFUARTCONSOLE - /* Check switch. */ - /* - if (0 == (ioreg_read(LUBBOCK_OBIO_VBASE+LUBBOCK_USERSW) & (1<<15))) { - */ if (0) { /* We don't use FF serial when S17=no-dot position */ } @@ -1324,7 +1255,7 @@ consinit(void) /* XXX: can't call pxa2x0_clkman_config yet */ pxa2x0_clkman_config(CKEN_FFUART, 1); #else - ioreg_write(LUBBOCK_CLKMAN_VBASE+CLKMAN_CKEN, + ioreg_write(ZAURUS_CLKMAN_VBASE+CLKMAN_CKEN, ckenreg|CKEN_FFUART); #endif @@ -1340,7 +1271,7 @@ consinit(void) #endif if (0 == comcnattach(&pxa2x0_a4x_bs_tag, PXA2X0_BTUART_BASE, comcnspeed, PXA2X0_COM_FREQ, comcnmode)) { - ioreg_write(LUBBOCK_CLKMAN_VBASE+CLKMAN_CKEN, + ioreg_write(ZAURUS_CLKMAN_VBASE+CLKMAN_CKEN, ckenreg|CKEN_BTUART); return; } @@ -1358,7 +1289,7 @@ kgdb_port_init(void) #if (NCOM > 0) && defined(COM_PXA2X0) paddr_t paddr = 0; enum pxa2x0_uart_id uart_id; - uint32_t ckenreg = ioreg_read(LUBBOCK_CLKMAN_VBASE+CLKMAN_CKEN); + uint32_t ckenreg = ioreg_read(ZAURUS_CLKMAN_VBASE+CLKMAN_CKEN); if (0 == strcmp(kgdb_devname, "ffuart")) { paddr = PXA2X0_FFUART_BASE; @@ -1373,32 +1304,12 @@ kgdb_port_init(void) 0 == com_kgdb_attach_pxa2x0(&pxa2x0_a4x_bs_tag, paddr, kgdb_rate, PXA2X0_COM_FREQ, COM_TYPE_PXA2x0, comkgdbmode)) { - ioreg_write(LUBBOCK_CLKMAN_VBASE+CLKMAN_CKEN, ckenreg); + ioreg_write(ZAURUS_CLKMAN_VBASE+CLKMAN_CKEN, ckenreg); } #endif } #endif -#if 0 -/* - * display a number in hex LED. - * a digit is blank when the corresponding bit in arg blank is 1 - */ -unsigned short led_control_value = 0; - -void -hex_led_blank(uint32_t value, int blank) -{ - int save = disable_interrupts(I32_bit); - - ioreg_write(LUBBOCK_OBIO_VBASE+0x10, value); - led_control_value = (led_control_value & 0xff) - | ((blank & 0xff)<<8); - ioreg_write(LUBBOCK_OBIO_VBASE+0x40, led_control_value); - restore_interrupts(save); -} -#endif - /* * Cotulla's integrated ICU doesn't have IRQ0..7, so * we map software interrupts to bit 0..3 |