Update of /cvsroot/linux-mips/linux/arch/mips/vr4111/clio-1000
In directory usw-pr-cvs1:/tmp/cvs-serv30742/arch/mips/vr4111/clio-1000
Added Files:
Makefile prom.c setup.c
Log Message:
Merged Vr4111 (Clio-1000) patch from Jim Paris.
--- NEW FILE: Makefile ---
#
# Makefile for the Vadem Clio 1000 / Sharp Mobilon Tripad PV-6000
#
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
.S.s:
$(CPP) $(AFLAGS) $< -o $@
.S.o:
$(CC) $(AFLAGS) -c $< -o $@
O_TARGET := clio-1000.o
all: clio-1000.o
obj-y := setup.o prom.o
include $(TOPDIR)/Rules.make
--- NEW FILE: prom.c ---
/*
* arch/mips/vr4111/clio-1000/prom.c
*
* Copyright (C) 1999 Bradley D. LaRonde and Michael Klar
*
* Copyright (C) 2001 Jim Paris <ji...@jt...>
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
*/
#include <linux/init.h>
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/bootmem.h>
#include <asm/bootinfo.h>
#include <asm/addrspace.h>
#include <asm/page.h>
#include <asm/vr41xx.h>
char arcs_cmdline[COMMAND_LINE_SIZE];
extern int _end;
#define min(a,b) (((a)<(b))?(a):(b))
unsigned long __init probe_ram_size(void)
{
unsigned long ramsize;
unsigned int *p1, *p2;
unsigned int d1, d2;
/* Begin probe starting with the first 1MB past the global data */
ramsize = ((unsigned long)&_end + 0x000fffff) & 0x1ff00000;
/* Probe sequential 1MB areas, looking for a lack of RAM */
while (ramsize < 0x04000000) {
/* Save the data and replace with a pattern */
p1 = (unsigned int *)(KSEG1 + ramsize + 0x000ffff0);
d1 = *p1;
*p1 = 0x1234a5a5;
barrier();
/* Do it again to ensure it's not an empty bus */
p2 = (unsigned int *)(KSEG1 + ramsize + 0x000fffe0);
d2 = *p2;
*p2 = 0x00ff5a5a;
barrier();
/* Is the first pattern there? */
if (*p1 != 0x1234a5a5)
break;
/* Put the old data back */
*p1 = d1;
*p2 = d2;
ramsize += 0x00100000;
}
return ramsize;
}
void __init prom_init(int argc, char **argv, char **envp)
{
unsigned long mem_detected;
int i;
/*
* Clear ERL and EXL in case the bootloader got us here
* through an exception
*/
write_32bit_cp0_register(CP0_STATUS, 0);
/*
* Collect args and prepare cmd_line
*/
strcpy(arcs_cmdline, "");
for (i = 1; i < argc; i++) {
strcat(arcs_cmdline, argv[i]);
if (i < (argc - 1))
strcat(arcs_cmdline, " ");
}
mips_machgroup = MACH_GROUP_NEC_VR41XX;
mips_machtype = MACH_VADEM_CLIO_1000;
mem_detected = probe_ram_size();
printk("Detected %dMB of memory.\n",(int)mem_detected >> 20);
add_memory_region(0, mem_detected, BOOT_MEM_RAM);
}
void __init prom_free_prom_memory(void)
{
}
--- NEW FILE: setup.c ---
/*
* linux/arch/mips/vr4111/setup.c
*
* VR41xx setup routines
*
* Copyright (C) 1999 Bradley D. LaRonde
* Copyright (C) 1999, 2000 Michael Klar
*
* Copyright 2001 MontaVista Software Inc.
* Author: js...@mv... or js...@ju...
*
* Copyright 2001 Jim Paris <ji...@jt...>
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
*/
#include <linux/config.h>
#include <linux/console.h>
#include <linux/ide.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <asm/time.h>
#include <asm/reboot.h>
#include <asm/vr41xx.h>
#include <asm/io.h>
extern void vr41xx_restart(char *c);
extern void vr4111_hibernate(void);
extern void vr4111_wait(void);
extern void vr4111_time_init(void);
extern void vr4111_timer_setup(void);
extern struct ide_ops std_ide_ops;
void __init put_cf_reg(unsigned char reg, unsigned char val)
{
/* PCMCIA controller (VG469) is mapped here */
outb(reg, 0x3e0);
outb(val, 0x3e1);
}
void __init clio_1000_setup(void)
{
unsigned short val;
mips_io_port_base = VR41XX_PORT_BASE;
isa_slot_offset = VR41XX_ISAMEM_BASE;
board_time_init = vr4111_time_init;
board_timer_setup = vr4111_timer_setup;
_machine_restart = vr41xx_restart;
_machine_halt = vr4111_hibernate;
_machine_power_off = vr4111_hibernate;
cpu_wait = vr4111_wait;
ide_ops = &std_ide_ops;
#ifdef CONFIG_FB
conswitchp = &dummy_con;
#endif
/* Reset the PCMCIA and CF and power them off */
put_cf_reg(0x03, 0x20); /* Socket 0 */
put_cf_reg(0x43, 0x20); /* Socket 1 */
put_cf_reg(0x02, 0x00); /* Socket 0 */
put_cf_reg(0x42, 0x00); /* Socket 1 */
/* Clio-specific RS232 enable */
*VR41XX_GIUPODATL |= VR41XX_GIUPODATL_GPIO42;
vr4111_init_serial();
/* Turn the green LED on (debug) */
*VR41XX_GIUPODATH = 0;
*VR41XX_GIUPODATH = 0x302;
*VR41XX_GIUPODATH = 0x303;
*VR41XX_GIUPODATH = 0;
}
|