mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
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 <rminnich@gmail.com> Acked-by: Ronald G. Minnich <rminnich@gmail.com> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@135 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
parent
f8682ef7f3
commit
0e68335b17
4 changed files with 106 additions and 3 deletions
|
@ -106,8 +106,8 @@ $(obj)/stage0.init: $(STAGE0_OBJ)
|
||||||
# TODO: This should be compressed with the default compressor.
|
# TODO: This should be compressed with the default compressor.
|
||||||
#
|
#
|
||||||
|
|
||||||
STAGE2_LIB_OBJ = $(obj)/clog2.o $(obj)/mem.o $(obj)/malloc.o \
|
STAGE2_LIB_OBJ = $(obj)/stage2.o $(obj)/clog2.o $(obj)/mem.o $(obj)/malloc.o \
|
||||||
$(obj)/stage2.o #$(obj)/tables.o
|
$(obj)/tables.o
|
||||||
STAGE2_DEVICE_OBJ = $(obj)/device.o $(obj)/device_util.o \
|
STAGE2_DEVICE_OBJ = $(obj)/device.o $(obj)/device_util.o \
|
||||||
$(obj)/root_device.o
|
$(obj)/root_device.o
|
||||||
STAGE2_ARCH_X86_OBJ = $(obj)/archtables.o $(obj)/linuxbios_table.o
|
STAGE2_ARCH_X86_OBJ = $(obj)/archtables.o $(obj)/linuxbios_table.o
|
||||||
|
|
|
@ -616,7 +616,7 @@ void dev_phase2(void)
|
||||||
if (dev->ops && dev->ops->phase1)
|
if (dev->ops && dev->ops->phase1)
|
||||||
{
|
{
|
||||||
printk(BIOS_DEBUG, "%s phase2\n", dev_path(dev));
|
printk(BIOS_DEBUG, "%s phase2\n", dev_path(dev));
|
||||||
dev->ops->phase1(dev);
|
dev->ops->phase2(dev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
post_code(0x4e);
|
post_code(0x4e);
|
||||||
|
|
|
@ -201,6 +201,107 @@ FLASH layout
|
||||||
|
|
||||||
\end_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
|
\begin_layout Section
|
||||||
Boot Process
|
Boot Process
|
||||||
\end_layout
|
\end_layout
|
||||||
|
|
|
@ -50,6 +50,7 @@ it with the version available from LANL.
|
||||||
#include <console/console.h>
|
#include <console/console.h>
|
||||||
#include <console/loglevel.h>
|
#include <console/loglevel.h>
|
||||||
#include <device/device.h>
|
#include <device/device.h>
|
||||||
|
#include <tables.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Main function of the DRAM part of LinuxBIOS.
|
* @brief Main function of the DRAM part of LinuxBIOS.
|
||||||
|
@ -102,6 +103,7 @@ int stage2(void)
|
||||||
dev_phase6();
|
dev_phase6();
|
||||||
|
|
||||||
post_code(0x70);
|
post_code(0x70);
|
||||||
|
write_tables();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue