mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
coreboot for the Switch
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 |
||
---|---|---|
Documentation | ||
HOWTO | ||
romimages | ||
src | ||
util | ||
.cvsignore | ||
AUTHORS | ||
ChangeLog | ||
NEWS | ||
README |
This is FreeBIOS. Requires bcc to compile 16-bit C code. Obtain bcc from ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/bcc.tar.gz Rough directory layout: chip is for chipset types. chip/intel is intel mainboards. chip/stpc is stpc systems. These are common files to both freebios and linuxbios. lib is architecture-indepedent (we hope) code that is used by both linuxbios and freebios. include is what you think. ---------------------------------------------------- LinuxBIOS ----------------------------------------------------- linuxbios is the linuxbios directory. Things for linuxbios ONLY live here. There is an inflate directory for the inflate code, a lib directory for common library code, an include directory, a kernel_patches directory for patches to the various kernels, and finally, Makefile.common, an included Makefile used by all the builds. Actual targets are done in caps (this is a Berkeley style thing). In each target are: 1) crt0.S for that target. These vary a bit by target, although they do include lots of common code. 2) Makefile. This mainly has -D stuff and it includes ../Makefile.common 3) ldscript.ld. We'd like to make this common, but they seem to vary a lot 4) linux. (YOU supply this). A soft link to a linux source tree. e.g. ln -s /usr/src/linux linux To make this you need a newer GAS. Our version that works is GNU assembler version 2.9.5 (i386-redhat-linux) using BFD version 2.9.5.0.22 This comes with redhat 6.2. To build, cd to the directory and make, viz. cd linuxbios/PM133 make You'll see the various compiles, then you'll see an ld step, then a step called mkrom. mkrom builds a 64k linuxbios rom image. Finally the linuxbios 64k image is concatenated with a stripped, compressed linux kernel and put into a file called 'romimage'. If you say make floppy it will build it and 'mcopy romimage a:'. This is for those of you with FLASH burners. ------------------------- LinuxBIOS structure ------------------------- Mkrom puts in a call to f000:fff0, which is the entry point for LinuxBIOS. This starts off in source form in crt0.S There are about 16 instructions of 16-bit code, in the include file ../../chip/intel/intel_start32.S. This is the absolute minimum amount of assembly code needed. This puts us into protected mode with 32-bit addresses. Next ram is turned on. We have tried hard to keep the 32-bit assembly to a minimum, and in fact what's there is really the little bit needed to get ram going, and the other little bit needed to print diagnostic messages to COM1 while RAM is set up. If you don't know it already you'll find getting SDRAM going is a real mess, though we're getting better at it bit by bit. The assembly code calls intel_main function (found in ../../chip/intel/intel_main.c). This function does all the remaining hardware setup in C. Please think hard about adding assembly! We do an awful lot in C, include cache, MTRR, MSR, and other setup. Finally, intel_main calls linuxbios_main (../inflate/main.c). This code unzips the kernel to 0x100000, and jumps to it. From that point on, Linux runs the show.