diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2011-03-16 21:10:18 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2011-03-16 21:10:18 +0000 |
commit | e5b90018c8525099fbf97489cc6a2c2c79518aec (patch) | |
tree | 8a77447d3d75d24778a0850463c0044d25deac9b /sys/arch/loongson | |
parent | 4e209f50b395e6dbe546f9126d6662554ee03171 (diff) |
Recognize LM6002 as prefix for earlier Fuloong designs, and also recognize
prefixless `1.2.*' version information as LM6002, with a warning message as
their may be surprises if there are non-Fuloong prototypes in the wild ever
with 1.2 PMON code.
Per discussion with Roland Kammerer who is the happy owner of an LM6002.
Diffstat (limited to 'sys/arch/loongson')
-rw-r--r-- | sys/arch/loongson/loongson/machdep.c | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/sys/arch/loongson/loongson/machdep.c b/sys/arch/loongson/loongson/machdep.c index 62577f97660..4a44dd24003 100644 --- a/sys/arch/loongson/loongson/machdep.c +++ b/sys/arch/loongson/loongson/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.24 2010/10/24 15:40:03 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.25 2011/03/16 21:10:17 miod Exp $ */ /* * Copyright (c) 2009, 2010 Miodrag Vallat. @@ -97,7 +97,7 @@ int bufcachepercent = BUFCACHEPERCENT; /* * Even though the system is 64bit, the hardware is constrained to up * to 2G of contigous physical memory (direct 2GB DMA area), so there - * is no particular constraint. paddr_t is long so: + * is no particular constraint. paddr_t is long so: */ struct uvm_constraint_range dma_constraint = { 0x0, 0xffffffffUL }; struct uvm_constraint_range *uvm_md_constraints[] = { NULL }; @@ -172,6 +172,7 @@ extern const struct platform yeeloong_platform; const struct bonito_flavour bonito_flavours[] = { /* Lemote Fuloong 2F mini-PC */ + { "LM6002", &fuloong_platform }, /* dual Ethernet, no prefix */ { "LM6003", &fuloong_platform }, { "LM6004", &fuloong_platform }, /* EMTEC Gdium Liberty 1000 */ @@ -311,6 +312,31 @@ mips_init(int32_t argc, int32_t argv, int32_t envp, int32_t cv, } if (sys_platform == NULL) { + /* + * Early Lemote designs shipped without a model prefix. + * Hopefully these well be close enough to the first + * generation Fuloong 2F design (LM6002); let's warn + * the user and try this if version is 1.2.something + * (1.3 onwards are expected to have a model prefix, + * and there are currently no reports of 1.1 and + * below being 2F systems). + * + * Note that this could be handled by adding a + * "1.2." machine type entry to the flavours table, + * but I prefer have it stand out. + * LM6002 users are encouraged to add the system + * model prefix to the `Version' variable. + */ + if (strncmp(envvar, "1.2.", 4) == 0) { + pmon_printf("No model prefix in version" + " string \"%s\".\n" + "Attempting to match as Lemote Fuloong\n", + envvar); + sys_platform = &fuloong_platform; + } + } + + if (sys_platform == NULL) { pmon_printf("This kernel doesn't support model \"%s\"." "\n", envvar); goto unsupported; @@ -626,7 +652,7 @@ consinit() } /* - * cpu_startup: allocate memory for variable-sized tables, initialize CPU, and + * cpu_startup: allocate memory for variable-sized tables, initialize CPU, and * do auto-configuration. */ void @@ -799,7 +825,7 @@ dumpconf(void) dumplo = nblks - btodb(ptoa(physmem)); /* - * Don't dump on the first page in case the dump device includes a + * Don't dump on the first page in case the dump device includes a * disk label. */ if (dumplo < btodb(PAGE_SIZE)) |