diff -urN linux-2.4-mips-20040120/arch/mips/Makefile linux-2.4-mips-20040120-patched/arch/mips/Makefile --- linux-2.4-mips-20040120/arch/mips/Makefile Tue Jan 20 18:23:30 2004 +++ linux-2.4-mips-20040120-patched/arch/mips/Makefile Tue Jan 20 19:30:33 2004 @@ -688,6 +688,15 @@ endif # +# Hawaii Aloha board +# +ifdef CONFIG_ALOHA +SUBDIRS += arch/mips/aloha +LIBS += arch/mips/aloha/aloha.o +LOADADDR += 0x80002000 +endif + +# # Choosing incompatible machines durings configuration will result in # error messages during linking. Select a default linkscript if # none has been choosen above. diff -urN linux-2.4-mips-20040120/arch/mips/aloha/Makefile linux-2.4-mips-20040120-patched/arch/mips/aloha/Makefile --- linux-2.4-mips-20040120/arch/mips/aloha/Makefile Wed Dec 31 19:00:00 1969 +++ linux-2.4-mips-20040120-patched/arch/mips/aloha/Makefile Tue Jan 20 19:40:00 2004 @@ -0,0 +1,21 @@ +# +# Makefile for Hawaii Aloha board +# +# 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) $(CFLAGS) $< -o $*.s +.S.o: + $(CC) $(CFLAGS) -c $< -o $*.o + +O_TARGET:= aloha.o + +obj-y := setup.o prom.o irq.o + +obj-$(CONFIG_BLK_DEV_INITRD) += ramdisk.o +obj-$(CONFIG_REMOTE_DEBUG) += dbg_io.o + +include $(TOPDIR)/Rules.make diff -urN linux-2.4-mips-20040120/arch/mips/aloha/irq.c linux-2.4-mips-20040120-patched/arch/mips/aloha/irq.c --- linux-2.4-mips-20040120/arch/mips/aloha/irq.c Wed Dec 31 19:00:00 1969 +++ linux-2.4-mips-20040120-patched/arch/mips/aloha/irq.c Tue Jan 20 19:40:00 2004 @@ -0,0 +1,46 @@ +/* + * Copyright 2001 MontaVista Software Inc. + * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net + * + * init_IRQ for aloha. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +extern void breakpoint(void); +extern int setup_irq(unsigned int irq, struct irqaction *irqaction); + +void __init init_IRQ(void) +{ + + /* we are not doing much right now !!! */ + return; + + /* set_except_vector(0, aloha_handle_irq); */ + +#ifdef CONFIG_REMOTE_DEBUG + printk("Setting debug traps - please connect the remote debugger.\n"); + + set_debug_traps(); + + breakpoint(); +#endif +} + diff -urN linux-2.4-mips-20040120/arch/mips/aloha/prom.c linux-2.4-mips-20040120-patched/arch/mips/aloha/prom.c --- linux-2.4-mips-20040120/arch/mips/aloha/prom.c Wed Dec 31 19:00:00 1969 +++ linux-2.4-mips-20040120-patched/arch/mips/aloha/prom.c Tue Feb 10 10:15:54 2004 @@ -0,0 +1,51 @@ +/* + * Copyright 2001 MontaVista Software Inc. + * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net + * + * arch/mips/aloha/prom.c + * prom setup file for aloha + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + *********************************************************************** + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +char arcs_cmdline[CL_SIZE]; + +const char *get_system_type(void) +{ + return "Hawaii Aloha"; +} + +void __init prom_init(void) +{ + strcpy(arcs_cmdline, "console=ttyS0,115200"); + strcat(arcs_cmdline, " ip=bootp"); + + /* you should these macros defined in include/asm/bootinfo.h */ + mips_machgroup = MACH_GROUP_HAWAII; + mips_machtype = MACH_ALOHA; + + /* Aloha board has 8 MB ram */ + add_memory_region(0, 8 << 20 , BOOT_MEM_RAM); +} + +void __init prom_free_prom_memory(void) +{ +} + +void __init prom_fixup_mem_map(unsigned long start, unsigned long end) +{ +} diff -urN linux-2.4-mips-20040120/arch/mips/aloha/setup.c linux-2.4-mips-20040120-patched/arch/mips/aloha/setup.c --- linux-2.4-mips-20040120/arch/mips/aloha/setup.c Wed Dec 31 19:00:00 1969 +++ linux-2.4-mips-20040120-patched/arch/mips/aloha/setup.c Tue Feb 10 10:14:47 2004 @@ -0,0 +1,82 @@ +/* + * Copyright 2001 MontaVista Software Inc. + * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net + * + * arch/mips/aloha/setup.c + * The setup file for aloha. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include /* for memset */ + +#include +#include +#include +#include +#include +#include +#include + +void aloha_restart(char *command) +{ + set_c0_status(ST0_BEV | ST0_ERL); + change_c0_config(CONF_CM_CMASK, CONF_CM_UNCACHED); + flush_cache_all(); + write_c0_wired(0); + __asm__ __volatile__("jr\t%0"::"r"(0xbfc00000)); +} + +void aloha_halt(void) +{ + printk(KERN_NOTICE "\n** You can safely turn off the power\n"); + while (1); +} + +void aloha_power_off(void) +{ + aloha_halt(); +} + +static void __init aloha_time_init(void) +{ + /* 100 (CPU clock) MHz divided by 8 */ + mips_hpt_frequency = 100000000 / 8; +} + +extern int setup_irq(unsigned int irq, struct irqaction *irqaction); +static void __init aloha_timer_setup(struct irqaction *irq) +{ + + unsigned int count; + + setup_irq(7, irq); + + /* to generate the first CPU timer interrupt */ + count = read_c0_count(); + write_c0_count(count + 1000); +} + + +void __init aloha_setup(void) +{ + printk("aloha_setup() starts.\n"); + + board_time_init = aloha_time_init; + board_timer_setup = aloha_timer_setup; + + _machine_restart = aloha_restart; + _machine_halt = aloha_halt; + _machine_power_off = aloha_power_off; +} diff -urN linux-2.4-mips-20040120/arch/mips/config-shared.in linux-2.4-mips-20040120-patched/arch/mips/config-shared.in --- linux-2.4-mips-20040120/arch/mips/config-shared.in Tue Jan 20 18:23:30 2004 +++ linux-2.4-mips-20040120-patched/arch/mips/config-shared.in Tue Jan 20 19:33:16 2004 @@ -19,6 +19,7 @@ # mainmenu_option next_comment comment 'Machine selection' +dep_bool 'Support for Hawaii Aloha board (EXPERIMENTAL)' CONFIG_ALOHA $CONFIG_EXPERIMENTAL dep_bool 'Support for Acer PICA 1 chipset (EXPERIMENTAL)' CONFIG_ACER_PICA_61 $CONFIG_EXPERIMENTAL dep_bool 'Support for Alchemy Bosporus board' CONFIG_MIPS_BOSPORUS $CONFIG_MIPS32 dep_bool 'Support for Alchemy Mirage board' CONFIG_MIPS_MIRAGE $CONFIG_MIPS32 @@ -708,6 +709,15 @@ define_bool CONFIG_NEW_PCI y define_bool CONFIG_PCI_AUTO y define_bool CONFIG_DUMMY_KEYB y + define_bool CONFIG_SCSI n +fi +if [ "$CONFIG_ALOHA" = "y" ]; then + define_bool CONFIG_CPU_R4X00 y + define_bool CONFIG_CPU_LITTLE_ENDIAN y + define_bool CONFIG_SERIAL y + define_bool CONFIG_SERIAL_MANY_PORTS y + define_bool CONFIG_NEW_IRQ y + define_bool CONFIG_NEW_TIME_C y define_bool CONFIG_SCSI n fi diff -urN linux-2.4-mips-20040120/arch/mips/kernel/setup.c linux-2.4-mips-20040120-patched/arch/mips/kernel/setup.c --- linux-2.4-mips-20040120/arch/mips/kernel/setup.c Wed Dec 17 22:35:15 2003 +++ linux-2.4-mips-20040120-patched/arch/mips/kernel/setup.c Tue Jan 20 19:26:45 2004 @@ -495,6 +495,7 @@ void hp_setup(void); void au1x00_setup(void); void frame_info_init(void); + void aloha_setup(void); frame_info_init(); #if defined(CONFIG_BLK_DEV_FD) || defined(CONFIG_BLK_DEV_FD_MODULE) @@ -691,6 +692,11 @@ case MACH_GROUP_TITAN: pmc_yosemite_setup(); break; +#endif +#ifdef CONFIG_ALOHA + case MACH_GROUP_HAWAII: + aloha_setup(); + break; #endif default: panic("Unsupported architecture"); diff -urN linux-2.4-mips-20040120/include/asm-mips/bootinfo.h linux-2.4-mips-20040120-patched/include/asm-mips/bootinfo.h --- linux-2.4-mips-20040120/include/asm-mips/bootinfo.h Tue Jan 20 18:23:41 2004 +++ linux-2.4-mips-20040120-patched/include/asm-mips/bootinfo.h Tue Feb 10 10:13:38 2004 @@ -37,6 +37,7 @@ #define MACH_GROUP_HP_LJ 20 /* Hewlett Packard LaserJet */ #define MACH_GROUP_LASAT 21 #define MACH_GROUP_TITAN 22 /* PMC-Sierra Titan */ +#define MACH_GROUP_HAWAII 23 /* For Hawaii Aloha board */ /* * Valid machtype values for group unknown (low order halfword of mips_machtype) @@ -197,6 +198,11 @@ * Valid machtype for group TITAN */ #define MACH_TITAN_YOSEMITE 1 /* PMC-Sierra Yosemite */ + +/* + * Valid machtype for group Hawaii + */ +#define MACH_ALOHA 0 /* Aloha */ #define CL_SIZE (256)