Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Setup pointers to hardware dependent routines.
0003  *
0004  * This file is subject to the terms and conditions of the GNU General Public
0005  * License.  See the file "COPYING" in the main directory of this archive
0006  * for more details.
0007  *
0008  * Copyright (C) 1996, 1997, 2004, 05 by Ralf Baechle (ralf@linux-mips.org)
0009  * Copyright (C) 2001, 2002, 2003 by Liam Davies (ldavies@agile.tv)
0010  *
0011  */
0012 #include <linux/init.h>
0013 #include <linux/interrupt.h>
0014 #include <linux/io.h>
0015 #include <linux/ioport.h>
0016 #include <linux/memblock.h>
0017 #include <linux/pm.h>
0018 
0019 #include <asm/bootinfo.h>
0020 #include <asm/reboot.h>
0021 #include <asm/setup.h>
0022 #include <asm/gt64120.h>
0023 
0024 #include <cobalt.h>
0025 
0026 extern void cobalt_machine_restart(char *command);
0027 extern void cobalt_machine_halt(void);
0028 
0029 const char *get_system_type(void)
0030 {
0031     switch (cobalt_board_id) {
0032         case COBALT_BRD_ID_QUBE1:
0033             return "Cobalt Qube";
0034         case COBALT_BRD_ID_RAQ1:
0035             return "Cobalt RaQ";
0036         case COBALT_BRD_ID_QUBE2:
0037             return "Cobalt Qube2";
0038         case COBALT_BRD_ID_RAQ2:
0039             return "Cobalt RaQ2";
0040     }
0041     return "MIPS Cobalt";
0042 }
0043 
0044 /*
0045  * Cobalt doesn't have PS/2 keyboard/mouse interfaces,
0046  * keyboard controller is never used.
0047  * Also PCI-ISA bridge DMA controller is never used.
0048  */
0049 static struct resource cobalt_reserved_resources[] = {
0050     {   /* dma1 */
0051         .start  = 0x00,
0052         .end    = 0x1f,
0053         .name   = "reserved",
0054         .flags  = IORESOURCE_BUSY | IORESOURCE_IO,
0055     },
0056     {   /* keyboard */
0057         .start  = 0x60,
0058         .end    = 0x6f,
0059         .name   = "reserved",
0060         .flags  = IORESOURCE_BUSY | IORESOURCE_IO,
0061     },
0062     {   /* dma page reg */
0063         .start  = 0x80,
0064         .end    = 0x8f,
0065         .name   = "reserved",
0066         .flags  = IORESOURCE_BUSY | IORESOURCE_IO,
0067     },
0068     {   /* dma2 */
0069         .start  = 0xc0,
0070         .end    = 0xdf,
0071         .name   = "reserved",
0072         .flags  = IORESOURCE_BUSY | IORESOURCE_IO,
0073     },
0074 };
0075 
0076 void __init plat_mem_setup(void)
0077 {
0078     int i;
0079 
0080     _machine_restart = cobalt_machine_restart;
0081     _machine_halt = cobalt_machine_halt;
0082     pm_power_off = cobalt_machine_halt;
0083 
0084     set_io_port_base(CKSEG1ADDR(GT_DEF_PCI0_IO_BASE));
0085 
0086     /* I/O port resource */
0087     ioport_resource.end = 0x01ffffff;
0088 
0089     /* These resources have been reserved by VIA SuperI/O chip. */
0090     for (i = 0; i < ARRAY_SIZE(cobalt_reserved_resources); i++)
0091         request_resource(&ioport_resource, cobalt_reserved_resources + i);
0092 }
0093 
0094 /*
0095  * Prom init. We read our one and only communication with the firmware.
0096  * Grab the amount of installed memory.
0097  * Better boot loaders (CoLo) pass a command line too :-)
0098  */
0099 
0100 void __init prom_init(void)
0101 {
0102     unsigned long memsz;
0103     int argc, i;
0104     char **argv;
0105 
0106     memsz = fw_arg0 & 0x7fff0000;
0107     argc = fw_arg0 & 0x0000ffff;
0108     argv = (char **)fw_arg1;
0109 
0110     for (i = 1; i < argc; i++) {
0111         strlcat(arcs_cmdline, argv[i], COMMAND_LINE_SIZE);
0112         if (i < (argc - 1))
0113             strlcat(arcs_cmdline, " ", COMMAND_LINE_SIZE);
0114     }
0115 
0116     memblock_add(0, memsz);
0117 
0118     setup_8250_early_printk_port(CKSEG1ADDR(0x1c800000), 0, 0);
0119 }