From 0e68335b1781881d35e7b42a491812a65b3cbce3 Mon Sep 17 00:00:00 2001 From: "Ronald G. Minnich" Date: Mon, 26 Feb 2007 19:24:33 +0000 Subject: [PATCH] Fix a typo in device.c -- calling phase1 in phase2 start documenting the device model -- since it is clear to me from reading v2 that not even the v2 guys totally got it call write_tables in stage2 fix the makefile to put stage2.o first to make sure it gets called. Signed-off-by: Ronald G. Minnich Acked-by: Ronald G. Minnich Acked-by: Stefan Reinauer git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@135 f3766cd6-281f-0410-b1cd-43a5c92072e9 --- arch/x86/Makefile | 4 +- device/device.c | 2 +- doc/design/newboot.lyx | 101 +++++++++++++++++++++++++++++++++++++++++ lib/stage2.c | 2 + 4 files changed, 106 insertions(+), 3 deletions(-) diff --git a/arch/x86/Makefile b/arch/x86/Makefile index cb2f17994b..6de41680b8 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -106,8 +106,8 @@ $(obj)/stage0.init: $(STAGE0_OBJ) # TODO: This should be compressed with the default compressor. # -STAGE2_LIB_OBJ = $(obj)/clog2.o $(obj)/mem.o $(obj)/malloc.o \ - $(obj)/stage2.o #$(obj)/tables.o +STAGE2_LIB_OBJ = $(obj)/stage2.o $(obj)/clog2.o $(obj)/mem.o $(obj)/malloc.o \ + $(obj)/tables.o STAGE2_DEVICE_OBJ = $(obj)/device.o $(obj)/device_util.o \ $(obj)/root_device.o STAGE2_ARCH_X86_OBJ = $(obj)/archtables.o $(obj)/linuxbios_table.o diff --git a/device/device.c b/device/device.c index fa788b6557..ecff9a286a 100644 --- a/device/device.c +++ b/device/device.c @@ -616,7 +616,7 @@ void dev_phase2(void) if (dev->ops && dev->ops->phase1) { printk(BIOS_DEBUG, "%s phase2\n", dev_path(dev)); - dev->ops->phase1(dev); + dev->ops->phase2(dev); } } post_code(0x4e); diff --git a/doc/design/newboot.lyx b/doc/design/newboot.lyx index cebf950f9e..dd5e99b401 100644 --- a/doc/design/newboot.lyx +++ b/doc/design/newboot.lyx @@ -201,6 +201,107 @@ FLASH layout \end_layout +\begin_layout Section +LinuxBIOS device structures +\end_layout + +\begin_layout Subsection +Resources +\end_layout + +\begin_layout Standard +Resources describe memory and I/O address ranges, IRQs, and DRQs. + They are define in include/device/resource.h. + There can be variations of a resource which include things like prefetchable, + cacheable, and so on. + +\end_layout + +\begin_layout Subsection +Path +\end_layout + +\begin_layout Standard +A path nams a way of accessing a device. + These are defined in include/device/path.h. + The path structure is in essence a case-variant type (struct which includes + a type and a union of all possible path types). + +\end_layout + +\begin_layout Section +Bus +\end_layout + +\begin_layout Standard +Busses, defined in include/device/device.h, connect parent devices to child + devices. + Busses are attached to a device, and have child devices attached to them. + +\end_layout + +\begin_layout Subsection +Devices +\end_layout + +\begin_layout Standard +Devices are defined in include/device/device.h. + Devices: +\end_layout + +\begin_layout Itemize +have a path +\end_layout + +\begin_layout Itemize +are attached to a bus +\end_layout + +\begin_layout Itemize +have sibling devices +\end_layout + +\begin_layout Itemize +have a vendor and device ID +\end_layout + +\begin_layout Itemize +have a class and hdr type +\end_layout + +\begin_layout Itemize +have several booleans, describing state, including enabled, initialized, + resources have been read, and on the mainboard +\end_layout + +\begin_layout Itemize +have a rom address, if a rom is attached to them (e.g. + VGA) +\end_layout + +\begin_layout Itemize +have a set of up to MAX_RESOURCES (currently 12) resources. + The resources are built into the structure and are not dynamically allocated. + Functions to manage the resources attached to a device are found in device/devi +ce_util.c +\end_layout + +\begin_layout Itemize +have links, which are usually empty in the case of everything but a bridge +\end_layout + +\begin_layout Itemize +have a set of device operations -- these are per-device-type +\end_layout + +\begin_layout Itemize +have a set of chip operations, per chip-type +\end_layout + +\begin_layout Itemize +have a chip information structure, which is per-chip instance +\end_layout + \begin_layout Section Boot Process \end_layout diff --git a/lib/stage2.c b/lib/stage2.c index 95a8e35371..b82b97f2ec 100644 --- a/lib/stage2.c +++ b/lib/stage2.c @@ -50,6 +50,7 @@ it with the version available from LANL. #include #include #include +#include /** * @brief Main function of the DRAM part of LinuxBIOS. @@ -102,6 +103,7 @@ int stage2(void) dev_phase6(); post_code(0x70); + write_tables(); return 0; }