From: Pete P. <pp...@us...> - 2002-09-26 05:39:42
|
Update of /cvsroot/linux-mips/linux/arch/mips/au1000/common In directory usw-pr-cvs1:/tmp/cvs-serv1799/arch/mips/au1000/common Modified Files: Makefile clocks.c power.c serial.c time.c Log Message: Split up the Pb board and Au CPU dependencies properly. Index: Makefile =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/au1000/common/Makefile,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Makefile 29 May 2002 00:23:16 -0000 1.10 +++ Makefile 26 Sep 2002 05:39:38 -0000 1.11 @@ -24,7 +24,7 @@ obj-y := prom.o int-handler.o dma.o irq.o puts.o time.o reset.o \ clocks.o power.o usbdev.o -obj-$(CONFIG_AU1000_UART) += serial.o +obj-$(CONFIG_AU1X00_UART) += serial.o obj-$(CONFIG_REMOTE_DEBUG) += dbg_io.o obj-$(CONFIG_RTC) += rtc.o Index: clocks.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/au1000/common/clocks.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- clocks.c 1 May 2002 18:00:28 -0000 1.5 +++ clocks.c 26 Sep 2002 05:39:38 -0000 1.6 @@ -30,21 +30,21 @@ #include <linux/module.h> #include <asm/au1000.h> -static unsigned int au1000_clock; // Hz +static unsigned int au1x00_clock; // Hz static unsigned int lcd_clock; // KHz static unsigned long uart_baud_base; /* * Set the au1000_clock */ -void set_au1000_speed(unsigned int new_freq) +void set_au1x00_speed(unsigned int new_freq) { - au1000_clock = new_freq; + au1x00_clock = new_freq; } -unsigned int get_au1000_speed(void) +unsigned int get_au1x00_speed(void) { - return au1000_clock; + return au1x00_clock; } @@ -54,27 +54,27 @@ * we want to be able to use the same code on different * speed CPUs. */ -unsigned long get_au1000_uart_baud_base(void) +unsigned long get_au1x00_uart_baud_base(void) { return uart_baud_base; } -void set_au1000_uart_baud_base(unsigned long new_baud_base) +void set_au1x00_uart_baud_base(unsigned long new_baud_base) { uart_baud_base = new_baud_base; } /* - * Calculate the Au1000's LCD clock based on the current + * Calculate the Au1x00's LCD clock based on the current * cpu clock and the system bus clock, and try to keep it * below 40 MHz (the Pb1000 board can lock-up if the LCD * clock is over 40 MHz). */ -void set_au1000_lcd_clock(void) +void set_au1x00_lcd_clock(void) { unsigned int static_cfg0; unsigned int sys_busclk = - (get_au1000_speed()/1000) / + (get_au1x00_speed()/1000) / ((int)(au_readl(SYS_POWERCTRL)&0x03) + 2); static_cfg0 = au_readl(MEM_STCFG0); @@ -90,9 +90,9 @@ lcd_clock); } -unsigned int get_au1000_lcd_clock(void) +unsigned int get_au1x00_lcd_clock(void) { return lcd_clock; } -EXPORT_SYMBOL(get_au1000_lcd_clock); +EXPORT_SYMBOL(get_au1x00_lcd_clock); Index: power.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/au1000/common/power.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- power.c 1 May 2002 18:00:29 -0000 1.8 +++ power.c 26 Sep 2002 05:39:38 -0000 1.9 @@ -52,10 +52,6 @@ extern void au1k_wait(void); static void calibrate_delay(void); -extern void set_au1000_speed(unsigned int new_freq); -extern unsigned int get_au1000_speed(void); -extern unsigned long get_au1000_uart_baud_base(void); -extern void set_au1000_uart_baud_base(unsigned long new_baud_base); extern unsigned long save_local_and_disable(int controller); extern void restore_local_and_enable(int controller, unsigned long mask); extern void local_enable_irq(unsigned int irq_nr); @@ -186,13 +182,13 @@ return -EFAULT; } - old_baud_base = get_au1000_uart_baud_base(); - old_cpu_freq = get_au1000_speed(); + old_baud_base = get_au1x00_uart_baud_base(); + old_cpu_freq = get_au1x00_speed(); new_cpu_freq = pll * 12 * 1000000; new_baud_base = (new_cpu_freq / 4) / 16; - set_au1000_speed(new_cpu_freq); - set_au1000_uart_baud_base(new_baud_base); + set_au1x00_speed(new_cpu_freq); + set_au1x00_uart_baud_base(new_baud_base); old_refresh = au_readl(MEM_SDREFCFG) & 0x1ffffff; new_refresh = Index: serial.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/au1000/common/serial.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- serial.c 19 Jun 2002 01:50:10 -0000 1.10 +++ serial.c 26 Sep 2002 05:39:38 -0000 1.11 @@ -1,7 +1,7 @@ /* * * BRIEF MODULE DESCRIPTION - * Au1000 serial port driver. + * Au1x00 serial port driver. * * Copyright 2001 MontaVista Software Inc. * Author: MontaVista Software, Inc. @@ -56,7 +56,7 @@ #undef SERIAL_DEBUG_AUTOCONF #ifdef MODULE -#undef CONFIG_AU1000_SERIAL_CONSOLE +#undef CONFIG_AU1X00_SERIAL_CONSOLE #endif #define CONFIG_SERIAL_RSA @@ -98,7 +98,7 @@ #include <linux/init.h> #include <asm/uaccess.h> #include <linux/delay.h> -#ifdef CONFIG_AU1000_SERIAL_CONSOLE +#ifdef CONFIG_AU1X00_SERIAL_CONSOLE #include <linux/console.h> #endif #ifdef CONFIG_MAGIC_SYSRQ @@ -131,8 +131,6 @@ static struct timer_list serial_timer; -extern unsigned long get_au1000_uart_baud_base(void); - /* serial subtype definitions */ #ifndef SERIAL_TYPE_NORMAL #define SERIAL_TYPE_NORMAL 1 @@ -149,11 +147,11 @@ static struct async_struct *IRQ_ports[NR_IRQS]; static int IRQ_timeout[NR_IRQS]; -#ifdef CONFIG_AU1000_SERIAL_CONSOLE +#ifdef CONFIG_AU1X00_SERIAL_CONSOLE static struct console sercons; static int lsr_break_flag; #endif -#if defined(CONFIG_AU1000_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) +#if defined(CONFIG_AU1X00_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) static unsigned long break_pressed; /* break, really ... */ #endif @@ -369,7 +367,7 @@ * may get masked by ignore_status_mask * or read_status_mask. */ -#if defined(CONFIG_AU1000_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) +#if defined(CONFIG_AU1X00_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) if (info->line == sercons.index) { if (!break_pressed) { break_pressed = jiffies; @@ -399,7 +397,7 @@ } *status &= info->read_status_mask; -#ifdef CONFIG_AU1000_SERIAL_CONSOLE +#ifdef CONFIG_AU1X00_SERIAL_CONSOLE if (info->line == sercons.index) { /* Recover the break flag from console xmit */ *status |= lsr_break_flag; @@ -429,7 +427,7 @@ goto ignore_char; } } -#if defined(CONFIG_AU1000_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) +#if defined(CONFIG_AU1X00_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) if (break_pressed && info->line == sercons.index) { if (ch != 0 && time_before(jiffies, break_pressed + HZ*5)) { @@ -1042,7 +1040,7 @@ if (!baud) { baud = 9600; /* B0 transition handled in rs_set_termios */ } - baud_base = get_au1000_uart_baud_base(); + baud_base = get_au1x00_uart_baud_base(); //if (baud == 38400 && if (((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST)) { @@ -2348,7 +2346,7 @@ *tty->termios = info->state->callout_termios; change_speed(info, 0); } -#ifdef CONFIG_AU1000_SERIAL_CONSOLE +#ifdef CONFIG_AU1X00_SERIAL_CONSOLE if (sercons.cflag && sercons.index == line) { tty->termios->c_cflag = sercons.cflag; sercons.cflag = 0; @@ -2575,7 +2573,7 @@ IRQ_ports[i] = 0; IRQ_timeout[i] = 0; } -#ifdef CONFIG_AU1000_SERIAL_CONSOLE +#ifdef CONFIG_AU1X00_SERIAL_CONSOLE /* * The interrupt of the serial console port * can't be shared. @@ -2654,7 +2652,7 @@ panic("Couldn't register callout driver"); for (i = 0, state = rs_table; i < NR_PORTS; i++,state++) { - state->baud_base = get_au1000_uart_baud_base(); + state->baud_base = get_au1x00_uart_baud_base(); state->magic = SSTATE_MAGIC; state->line = i; state->type = PORT_UNKNOWN; @@ -2851,7 +2849,7 @@ module_init(rs_init); module_exit(rs_fini); -MODULE_DESCRIPTION("Au1000 serial driver"); +MODULE_DESCRIPTION("Au1x00 serial driver"); /* @@ -2859,7 +2857,7 @@ * Serial console driver * ------------------------------------------------------------ */ -#ifdef CONFIG_AU1000_SERIAL_CONSOLE +#ifdef CONFIG_AU1X00_SERIAL_CONSOLE #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) @@ -3050,7 +3048,7 @@ info->io_type = state->io_type; info->iomem_base = state->iomem_base; info->iomem_reg_shift = state->iomem_reg_shift; - state->baud_base = get_au1000_uart_baud_base(); + state->baud_base = get_au1x00_uart_baud_base(); quot = state->baud_base / baud; cval = cflag & (CSIZE | CSTOPB); @@ -3090,7 +3088,7 @@ /* * Register console. */ -void __init au1000_serial_console_init(void) +void __init au1x00_serial_console_init(void) { register_console(&sercons); } Index: time.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/au1000/common/time.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- time.c 1 May 2002 18:00:29 -0000 1.12 +++ time.c 26 Sep 2002 05:39:39 -0000 1.13 @@ -201,7 +201,7 @@ count = read_32bit_cp0_register(CP0_COUNT); cpu_speed = count * 2; mips_counter_frequency = count; - set_au1000_uart_baud_base(((cpu_speed) / 4) / 16); + set_au1x00_uart_baud_base(((cpu_speed) / 4) / 16); restore_flags(flags); return (cpu_speed / HZ); } @@ -221,8 +221,8 @@ est_freq -= est_freq%10000; printk("CPU frequency %d.%02d MHz\n", est_freq/1000000, (est_freq%1000000)*100/1000000); - set_au1000_speed(est_freq); - set_au1000_lcd_clock(); // program the LCD clock + set_au1x00_speed(est_freq); + set_au1x00_lcd_clock(); // program the LCD clock r4k_cur = (read_32bit_cp0_register(CP0_COUNT) + r4k_offset); write_32bit_cp0_register(CP0_COMPARE, r4k_cur); |