mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
make.base(i386 & alpha)
make.base -- renamed OBJECTS to OBJECTS-1 to allow conditional compilation of objects ldscript.base -- realized that assignemnts to the location counter inside of sections are relative to their start so simplfied the code pirq_routing.h -- includeded types.h so we don't have suprises hardwaremain.c -- unconditionally included arch/smp/mpsec.h arch/i386/smp/Config introduced conitional on the compilation objects into the compilation process ioapic.c -- removed (now) unneeded ifdef around this file mpsec.c -- removed (now) unneeded ifdef around this file cpu/cpufixup.h -- Fix typo in the case when no cpufixup is needed. parts/framebuffer.h -- Added a missing semicolon. smp/atomic.h -- renamed second atmoic_inc to atomic_dec oops. tyan/guinnes/Config -- reordered the options so they are grouped a little better and said mptable.o is dependent on HAVE_MP_TABLE tyan/guiness/mainboard.c -- small change for clarity. northsouthbridge/sis/630/northbridge.c northsouthbridge/sis/630/southbridge.c -- Remove unused include of the now dead param.h NLBConfig.py -- Only include numeric options in the linker script -- Update to handle adding a condition for when to build objects
This commit is contained in:
parent
94b5887f47
commit
71be41d193
16 changed files with 47 additions and 48 deletions
|
@ -16,8 +16,8 @@ makerule documentation: $(SOURCES) ; doxygen LinuxBIOSDoc.config
|
||||||
addaction linuxbios $(LINK)
|
addaction linuxbios $(LINK)
|
||||||
addaction linuxbios nm -n linuxbios > linuxbios.map
|
addaction linuxbios nm -n linuxbios > linuxbios.map
|
||||||
|
|
||||||
makerule linuxbios.a : $(OBJECTS) ; rm -f linuxbios.a
|
makerule linuxbios.a : $(OBJECTS-1) ; rm -f linuxbios.a
|
||||||
addaction linuxbios.a ar cr linuxbios.a $(OBJECTS)
|
addaction linuxbios.a ar cr linuxbios.a $(OBJECTS-1)
|
||||||
|
|
||||||
makerule crt0.s: crt0.S ; $(CC) $(CPPFLAGS) -I$(TOP)/src -E $< > crt0.s
|
makerule crt0.s: crt0.S ; $(CC) $(CPPFLAGS) -I$(TOP)/src -E $< > crt0.s
|
||||||
|
|
||||||
|
|
|
@ -96,24 +96,20 @@ SECTIONS
|
||||||
.heap (.): {
|
.heap (.): {
|
||||||
_heap = .;
|
_heap = .;
|
||||||
/* Reserve 256K for the heap */
|
/* Reserve 256K for the heap */
|
||||||
. = . + ( HEAP_SIZE );
|
. = HEAP_SIZE ;
|
||||||
_eheap = .;
|
_eheap = .;
|
||||||
}
|
}
|
||||||
.stack (.) : {
|
.stack (.) : {
|
||||||
_stack = .;
|
_stack = .;
|
||||||
/* Reserve 64k stack for each possible cpu */
|
/* Reserve 64k stack for each possible cpu */
|
||||||
. = . + ((MAX_CPUS) * (STACK_SIZE));
|
. = ((MAX_CPUS) * (STACK_SIZE));
|
||||||
_estack = .;
|
_estack = .;
|
||||||
}
|
}
|
||||||
_lreset = _eldata;
|
_lreset = _ROMTOP;
|
||||||
. = _lreset;
|
. = _lreset;
|
||||||
_deadspace = (_ROMTOP - _lreset);
|
|
||||||
.reset (.) : AT (_lreset) {
|
.reset (.) : AT (_lreset) {
|
||||||
. = . + _deadspace;
|
|
||||||
_reset_vector = .;
|
|
||||||
*(.reset_vector)
|
*(.reset_vector)
|
||||||
_ereset_vector = . ;
|
. = 15 ;
|
||||||
. = . + (16 - (1 + (_ereset_vector - _reset_vector)));
|
|
||||||
BYTE(0x00);
|
BYTE(0x00);
|
||||||
}
|
}
|
||||||
_elreset = _lreset + SIZEOF(.reset);
|
_elreset = _lreset + SIZEOF(.reset);
|
||||||
|
|
|
@ -38,8 +38,8 @@ makerule etags: $(SOURCES) ; etags $(SOURCES)
|
||||||
makerule tags: $(SOURCES) ; gctags $(SOURCES)
|
makerule tags: $(SOURCES) ; gctags $(SOURCES)
|
||||||
makerule documentation: $(SOURCES) ; doxygen LinuxBIOSDoc.config
|
makerule documentation: $(SOURCES) ; doxygen LinuxBIOSDoc.config
|
||||||
|
|
||||||
makerule linuxbios.a : $(OBJECTS) ; rm -f linuxbios.a
|
makerule linuxbios.a : $(OBJECTS-1) ; rm -f linuxbios.a
|
||||||
addaction linuxbios.a ar cr linuxbios.a $(OBJECTS)
|
addaction linuxbios.a ar cr linuxbios.a $(OBJECTS-1)
|
||||||
|
|
||||||
makerule crt0.s: crt0.S $(TOP)/src/cpu/p5/start32.inc ; $(CPP) $(CPPFLAGS) -I$(TOP)/src $< > crt0.s
|
makerule crt0.s: crt0.S $(TOP)/src/cpu/p5/start32.inc ; $(CPP) $(CPPFLAGS) -I$(TOP)/src $< > crt0.s
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#ifndef ARCH_PIRQ_ROUTING_H
|
#ifndef ARCH_PIRQ_ROUTING_H
|
||||||
#define ARCH_PIRQ_ROUTING_H
|
#define ARCH_PIRQ_ROUTING_H
|
||||||
|
|
||||||
|
#include <types.h>
|
||||||
|
|
||||||
#define PIRQ_SIGNATURE (('$' << 0) + ('P' << 8) + ('I' << 16) + ('R' << 24))
|
#define PIRQ_SIGNATURE (('$' << 0) + ('P' << 8) + ('I' << 16) + ('R' << 24))
|
||||||
#define PIRQ_VERSION 0x0100
|
#define PIRQ_VERSION 0x0100
|
||||||
|
|
||||||
|
|
|
@ -56,9 +56,7 @@ static char rcsid[] = "$Id$";
|
||||||
#include <arch/pirq_routing.h>
|
#include <arch/pirq_routing.h>
|
||||||
#include <arch/ioapic.h>
|
#include <arch/ioapic.h>
|
||||||
#include <smp/atomic.h>
|
#include <smp/atomic.h>
|
||||||
#if defined(SMP)
|
#include <arch/smp/mpspec.h>
|
||||||
#include<arch/smp/mpspec.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
static int cpu_initialize(unsigned long totalram)
|
static int cpu_initialize(unsigned long totalram)
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
object mpspec.o
|
object mpspec.o HAVE_MP_TABLE
|
||||||
object ioapic.o
|
object ioapic.o IOAPIC
|
||||||
object start_stop.o
|
object start_stop.o SMP
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
#if defined(IOAPIC)
|
|
||||||
#include <arch/ioapic.h>
|
#include <arch/ioapic.h>
|
||||||
#include <printk.h>
|
#include <printk.h>
|
||||||
|
|
||||||
|
@ -134,4 +133,3 @@ void setup_ioapic(void)
|
||||||
a->reg, a->value_low, a->value_high);
|
a->reg, a->value_low, a->value_high);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* IOAPIC */
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#ifdef HAVE_MP_TABLE
|
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "$Id$";
|
static char rcsid[] = "$Id$";
|
||||||
#endif
|
#endif
|
||||||
|
@ -240,4 +238,3 @@ void write_smp_table(void *v)
|
||||||
}
|
}
|
||||||
#endif /* 0 */
|
#endif /* 0 */
|
||||||
|
|
||||||
#endif /* HAVE_MP_TABLE */
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
# define cpufixup(totalram) p6_cpufixup(totalram)
|
# define cpufixup(totalram) p6_cpufixup(totalram)
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
# define cpu_fixup(totalram) do {} while(0)
|
# define cpufixup(totalram) do {} while(0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CPU_CPUFIXUP_H */
|
#endif /* CPU_CPUFIXUP_H */
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#define PART_FRAMEBUFFER_H
|
#define PART_FRAMEBUFFER_H
|
||||||
|
|
||||||
#ifdef HAVE_FRAMEBUFFER
|
#ifdef HAVE_FRAMEBUFFER
|
||||||
void framebuffer_on(void)
|
void framebuffer_on(void);
|
||||||
#else
|
#else
|
||||||
# define framebuffer_on() do {} while(0)
|
# define framebuffer_on() do {} while(0)
|
||||||
#endif /* HAVE_FRAMEBUFFER */
|
#endif /* HAVE_FRAMEBUFFER */
|
||||||
|
|
|
@ -45,7 +45,7 @@ typedef struct { int counter; } atomic_t;
|
||||||
* Atomically decrements @v by 1. Note that the guaranteed
|
* Atomically decrements @v by 1. Note that the guaranteed
|
||||||
* useful range of an atomic_t is only 24 bits.
|
* useful range of an atomic_t is only 24 bits.
|
||||||
*/
|
*/
|
||||||
#define atomic_inc(v) (((v)->counter)--)
|
#define atomic_dec(v) (((v)->counter)--)
|
||||||
|
|
||||||
|
|
||||||
#endif /* SMP */
|
#endif /* SMP */
|
||||||
|
|
|
@ -27,7 +27,7 @@ option ENABLE_FIXED_AND_VARIABLE_MTRRS
|
||||||
|
|
||||||
|
|
||||||
object mainboard.o
|
object mainboard.o
|
||||||
object mptable.o
|
object mptable.o HAVE_MP_TABLE
|
||||||
#object irq_tables.o
|
#object irq_tables.o
|
||||||
#keyboard pc80
|
#keyboard pc80
|
||||||
dir ../../../pc80
|
dir ../../../pc80
|
||||||
|
@ -40,12 +40,12 @@ option SMBUS_MEM_DEVICE_INC=1
|
||||||
option SIO_BASE=0x2e
|
option SIO_BASE=0x2e
|
||||||
option SMP=1
|
option SMP=1
|
||||||
option IOAPIC=1
|
option IOAPIC=1
|
||||||
|
option MAX_CPUS=2
|
||||||
|
option HAVE_MP_TABLE=1
|
||||||
option USE_AMD_NDA_CODE=1
|
option USE_AMD_NDA_CODE=1
|
||||||
option FINAL_MAINBOARD_FIXUP=1
|
option FINAL_MAINBOARD_FIXUP=1
|
||||||
option HAVE_HARD_RESET=1
|
option HAVE_HARD_RESET=1
|
||||||
option HAVE_MP_TABLE=1
|
|
||||||
option STACK_SIZE=0x10000
|
option STACK_SIZE=0x10000
|
||||||
option MAX_CPUS=2
|
|
||||||
option XIP_ROM_SIZE=0x8000
|
option XIP_ROM_SIZE=0x8000
|
||||||
option XIP_ROM_BASE=0xffff8000
|
option XIP_ROM_BASE=0xffff8000
|
||||||
nooption MEMORY_HOLE
|
nooption MEMORY_HOLE
|
||||||
|
|
|
@ -427,7 +427,7 @@ static void setup_pci_irq_to_isa_routing(void)
|
||||||
* PIRQC -> 11
|
* PIRQC -> 11
|
||||||
* PIRQD -> 3
|
* PIRQD -> 3
|
||||||
*/
|
*/
|
||||||
pci_write_config_word(dev, 0x56, 0x3ba5);
|
pci_write_config_word(dev, 0x56,(3 << 12)|(0xb << 8)|(0xa <<4)|(5 <<0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@ static char rcsid[] =
|
||||||
#include <subr.h>
|
#include <subr.h>
|
||||||
#include <pci.h>
|
#include <pci.h>
|
||||||
#include <pci_ids.h>
|
#include <pci_ids.h>
|
||||||
#include <northsouthbridge/sis/630/param.h>
|
|
||||||
|
|
||||||
/* these functions query the hardware to figure out how much ram is in
|
/* these functions query the hardware to figure out how much ram is in
|
||||||
* the machine. They then place that information in the parameter block.
|
* the machine. They then place that information in the parameter block.
|
||||||
|
|
|
@ -16,7 +16,6 @@ static char rcsid[] =
|
||||||
#include <subr.h>
|
#include <subr.h>
|
||||||
#include <pci.h>
|
#include <pci.h>
|
||||||
#include <pci_ids.h>
|
#include <pci_ids.h>
|
||||||
#include <northsouthbridge/sis/630/param.h>
|
|
||||||
#include <cpu/p5/io.h>
|
#include <cpu/p5/io.h>
|
||||||
|
|
||||||
void keyboard_on()
|
void keyboard_on()
|
||||||
|
|
|
@ -40,17 +40,17 @@ def add_main_rule_dependency(new_dependency):
|
||||||
# this is a tuple, object name, source it depends on,
|
# this is a tuple, object name, source it depends on,
|
||||||
# and an optional rule (can be empty) for actually building
|
# and an optional rule (can be empty) for actually building
|
||||||
# the object
|
# the object
|
||||||
def addobject(object, sourcepath, rule):
|
def addobject(object, sourcepath, rule, condition):
|
||||||
objectrules.append([object, sourcepath, rule])
|
objectrules.append([object, sourcepath, rule, condition])
|
||||||
|
|
||||||
# OK, let's face it, make sucks.
|
# OK, let's face it, make sucks.
|
||||||
# if you have a rule like this:
|
# if you have a rule like this:
|
||||||
# a.o: /some/long/path/a.c
|
# a.o: /some/long/path/a.c
|
||||||
# make won't apply the .c.o rule. Toy!
|
# make won't apply the .c.o rule. Toy!
|
||||||
|
|
||||||
def addobject_defaultrule(object, sourcepath):
|
def addobject_defaultrule(object, sourcepath, condition):
|
||||||
defaultrule = "\t $(CC) -c $(CFLAGS) $<"
|
defaultrule = "\t $(CC) -c $(CFLAGS) -o $@ $<"
|
||||||
objectrules.append([object, sourcepath, defaultrule])
|
addobject(object, sourcepath, defaultrule, condition)
|
||||||
|
|
||||||
# for all these functions, you need:
|
# for all these functions, you need:
|
||||||
# the dir that the Config file is in
|
# the dir that the Config file is in
|
||||||
|
@ -136,7 +136,7 @@ def keyboard(dir, keyboard_name):
|
||||||
if (debug):
|
if (debug):
|
||||||
print "KEYBOARD"
|
print "KEYBOARD"
|
||||||
keyboard_dir = os.path.join(treetop, 'src', keyboard_name)
|
keyboard_dir = os.path.join(treetop, 'src', keyboard_name)
|
||||||
addobject_defaultrule('keyboard.o', keyboard_dir)
|
addobject_defaultrule('keyboard.o', keyboard_dir,'')
|
||||||
|
|
||||||
def cpu(dir, cpu_name):
|
def cpu(dir, cpu_name):
|
||||||
common_command_action(dir, 'cpu', cpu_name)
|
common_command_action(dir, 'cpu', cpu_name)
|
||||||
|
@ -165,7 +165,7 @@ def superio(dir, superio_name):
|
||||||
# note that superio is w.r.t. treetop
|
# note that superio is w.r.t. treetop
|
||||||
buildfullpath('superio', superio_name)
|
buildfullpath('superio', superio_name)
|
||||||
dir = os.path.join(treetop, 'src', 'superio', superio_name)
|
dir = os.path.join(treetop, 'src', 'superio', superio_name)
|
||||||
addobject_defaultrule('superio.o', dir)
|
addobject_defaultrule('superio.o', dir,'')
|
||||||
|
|
||||||
# commands are of the form:
|
# commands are of the form:
|
||||||
# superio_name [name=val]*
|
# superio_name [name=val]*
|
||||||
|
@ -186,11 +186,10 @@ def nsuperio(dir, superio_commands):
|
||||||
superio_decl_name = re.sub("/", "_", superio_name)
|
superio_decl_name = re.sub("/", "_", superio_name)
|
||||||
buildfullpath('superio', superio_name)
|
buildfullpath('superio', superio_name)
|
||||||
dir = os.path.join(treetop, 'src', 'superio', superio_name)
|
dir = os.path.join(treetop, 'src', 'superio', superio_name)
|
||||||
defaultrule = "\t $(CC) -c $(CFLAGS) -o $@ $<"
|
|
||||||
object="superio_%s.o" % superio_decl_name
|
object="superio_%s.o" % superio_decl_name
|
||||||
superio_source = dir + "/superio.c"
|
superio_source = dir + "/superio.c"
|
||||||
objectrules.append([object, superio_source, defaultrule])
|
addobject_defaultrule(object, superio_source,'')
|
||||||
addobject_defaultrule('nsuperio.o', "")
|
addobject_defaultrule('nsuperio.o', "", '')
|
||||||
rest = m.group(2)
|
rest = m.group(2)
|
||||||
superio_cmds = '';
|
superio_cmds = '';
|
||||||
m = command_re.match(rest)
|
m = command_re.match(rest)
|
||||||
|
@ -230,8 +229,13 @@ def mainboardinit(dir, file):
|
||||||
mainboardfilelist.append(file)
|
mainboardfilelist.append(file)
|
||||||
print "Added mainboard init file: ", file
|
print "Added mainboard init file: ", file
|
||||||
|
|
||||||
def object(dir, obj_name):
|
def object(dir, command):
|
||||||
addobject_defaultrule(obj_name, dir)
|
wspc = string.whitespace
|
||||||
|
command_re = re.compile("([^" + wspc + "]+)([" + wspc + "]([^" + wspc + "]*)|)")
|
||||||
|
m = command_re.match(command)
|
||||||
|
obj_name = m.group(1)
|
||||||
|
condition = m.group(3)
|
||||||
|
addobject_defaultrule(obj_name, dir, condition)
|
||||||
|
|
||||||
# for eventual user-defined rules.
|
# for eventual user-defined rules.
|
||||||
# pattern is name : deps ; rule
|
# pattern is name : deps ; rule
|
||||||
|
@ -510,8 +514,9 @@ def writeldscript(path):
|
||||||
keys = makeoptions.keys()
|
keys = makeoptions.keys()
|
||||||
keys.sort()
|
keys.sort()
|
||||||
for key in keys:
|
for key in keys:
|
||||||
if makeoptions[key] :
|
value = makeoptions[key]
|
||||||
file.write("%s = %s;\n" % (key, makeoptions[key]))
|
if re.match("^(0x[0-9a-fA-F]+|0[0-7]+|[0-9]+)$", value):
|
||||||
|
file.write("%s = %s;\n" % (key, value))
|
||||||
|
|
||||||
ldlines = readfile(ldscriptbase)
|
ldlines = readfile(ldscriptbase)
|
||||||
if (debug):
|
if (debug):
|
||||||
|
@ -581,9 +586,14 @@ def writemakefile(path):
|
||||||
|
|
||||||
# print out all the object dependencies
|
# print out all the object dependencies
|
||||||
# There is ALWAYS a crt0.o
|
# There is ALWAYS a crt0.o
|
||||||
file.write("OBJECTS=crt0.o\n")
|
file.write("OBJECTS-1 := crt0.o\n")
|
||||||
for i in range(len(objectrules)):
|
for i in range(len(objectrules)):
|
||||||
file.write("OBJECTS += %s\n" % (objectrules[i][0]))
|
obj_name = objectrules[i][0]
|
||||||
|
obj_cond = objectrules[i][3]
|
||||||
|
if not obj_cond :
|
||||||
|
file.write("OBJECTS-1 += %s\n" % (obj_name))
|
||||||
|
else:
|
||||||
|
file.write("OBJECTS-$(%s) += %s\n" % (obj_cond, obj_name))
|
||||||
|
|
||||||
file.write("SOURCES=\n")
|
file.write("SOURCES=\n")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue