PERFORCE change 176877 for review
Rafal Jaworowski
raj at FreeBSD.org
Tue Apr 13 20:50:29 UTC 2010
http://p4web.freebsd.org/@@176877?ac=10
Change 176877 by raj at raj_fdt on 2010/04/13 20:49:33
Eliminate bootinfo. This alters loader-kernel ABI.
Bootinfo is not needed since we're fully DT-driven.
Affected files ...
.. //depot/projects/fdt/sys/arm/include/bootinfo.h#3 delete
.. //depot/projects/fdt/sys/arm/include/metadata.h#4 edit
.. //depot/projects/fdt/sys/arm/mv/mv_machdep.c#13 edit
.. //depot/projects/fdt/sys/boot/uboot/common/metadata.c#7 edit
.. //depot/projects/fdt/sys/powerpc/booke/locore.S#2 edit
.. //depot/projects/fdt/sys/powerpc/booke/machdep.c#10 edit
.. //depot/projects/fdt/sys/powerpc/include/bootinfo.h#4 delete
.. //depot/projects/fdt/sys/powerpc/include/metadata.h#4 edit
Differences ...
==== //depot/projects/fdt/sys/arm/include/metadata.h#4 (text+ko) ====
@@ -29,7 +29,6 @@
#ifndef _MACHINE_METADATA_H_
#define _MACHINE_METADATA_H_
-#define MODINFOMD_BOOTINFO 0x1001
-#define MODINFOMD_DTBP 0x1002
+#define MODINFOMD_DTBP 0x1001
#endif /* !_MACHINE_METADATA_H_ */
==== //depot/projects/fdt/sys/arm/mv/mv_machdep.c#13 (text+ko) ====
@@ -87,7 +87,6 @@
#include <machine/armreg.h>
#include <machine/bus.h>
#include <sys/reboot.h>
-#include <machine/bootinfo.h>
#include <arm/mv/mvreg.h> /* XXX */
#include <arm/mv/mvvar.h> /* XXX eventually this should be eliminated */
@@ -148,11 +147,8 @@
static struct mem_region availmem_regions[FDT_MEM_REGIONS];
static int availmem_regions_sz;
-struct bootinfo *bootinfo;
-
static void print_kenv(void);
static void print_kernel_section_addr(void);
-static void print_bootinfo(void);
static void physmap_init(int);
static int platform_devmap_init(void);
@@ -191,22 +187,6 @@
}
static void
-print_bootinfo(void)
-{
-
- debugf("bootinfo:\n");
- if (bootinfo == NULL) {
- debugf(" no bootinfo, null ptr\n");
- return;
- }
-
- debugf(" version = 0x%08x\n", bootinfo->bi_version);
- debugf(" ccsrbar = 0x%08x\n", bootinfo->bi_bar_base);
- debugf(" cpu_clk = 0x%08x\n", bootinfo->bi_cpu_clk);
- debugf(" bus_clk = 0x%08x\n", bootinfo->bi_bus_clk);
-}
-
-static void
print_kernel_section_addr(void)
{
@@ -359,9 +339,6 @@
preload_metadata = mdp;
kmdp = preload_search_by_type("elf kernel");
if (kmdp != NULL) {
- bootinfo = (struct bootinfo *)preload_search_info(kmdp,
- MODINFO_METADATA | MODINFOMD_BOOTINFO);
-
boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int);
kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *);
dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t);
@@ -557,7 +534,6 @@
debugf(" arg1 mdp = 0x%08x\n", (uint32_t)mdp);
debugf(" boothowto = 0x%08x\n", boothowto);
printf(" dtbp = 0x%08x\n", (uint32_t)dtbp);
- print_bootinfo();
print_kernel_section_addr();
print_kenv();
==== //depot/projects/fdt/sys/boot/uboot/common/metadata.c#7 (text+ko) ====
@@ -36,7 +36,6 @@
#include <machine/elf.h>
#include <machine/metadata.h>
-#include <machine/bootinfo.h>
#include "api_public.h"
#include "bootstrap.h"
@@ -258,35 +257,6 @@
}
/*
- * Prepare the bootinfo structure. Put a ptr to the allocated struct in addr,
- * return size.
- */
-static int
-md_bootinfo(struct bootinfo **addr)
-{
- struct bootinfo *bi;
- struct sys_info *si;
- int size;
-
- if ((si = ub_get_sys_info()) == NULL)
- panic("can't retrieve U-Boot sysinfo");
-
- size = sizeof(struct bootinfo);
-
- if ((bi = malloc(size)) == NULL)
- panic("can't allocate mem for bootinfo");
-
- bi->bi_version = BI_VERSION;
- bi->bi_bar_base = si->bar;
- bi->bi_cpu_clk = si->clk_cpu;
- bi->bi_bus_clk = si->clk_bus;
-
- *addr = bi;
-
- return (size);
-}
-
-/*
* Load the information expected by a powerpc kernel.
*
* - The 'boothowto' argument is constructed
@@ -300,7 +270,6 @@
struct preloaded_file *kfp, *bfp;
struct preloaded_file *xp;
struct file_metadata *md;
- struct bootinfo *bip;
vm_offset_t kernend;
vm_offset_t addr;
vm_offset_t envp;
@@ -309,7 +278,6 @@
vm_offset_t dtbp;
char *rootdevname;
int howto;
- int bisize;
int i;
/*
@@ -350,9 +318,6 @@
/* Pad to a page boundary */
addr = roundup(addr, PAGE_SIZE);
- /* Prepare bootinfo */
- bisize = md_bootinfo(&bip);
-
kernend = 0;
kfp = file_findfile(NULL, "elf32 kernel");
if (kfp == NULL)
@@ -360,7 +325,6 @@
if (kfp == NULL)
panic("can't find kernel file");
file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto, &howto);
- file_addmetadata(kfp, MODINFOMD_BOOTINFO, bisize, bip);
file_addmetadata(kfp, MODINFOMD_ENVP, sizeof envp, &envp);
#if defined(LOADER_FDT_SUPPORT)
==== //depot/projects/fdt/sys/powerpc/booke/locore.S#2 (text+ko) ====
@@ -39,7 +39,6 @@
#include <machine/trap.h>
#include <machine/vmparam.h>
#include <machine/tlb.h>
-#include <machine/bootinfo.h>
#define TMPSTACKSZ 16384
==== //depot/projects/fdt/sys/powerpc/booke/machdep.c#10 (text+ko) ====
@@ -129,7 +129,6 @@
#include <machine/mmuvar.h>
#include <machine/sigframe.h>
#include <machine/metadata.h>
-#include <machine/bootinfo.h>
#include <machine/platform.h>
#include <sys/linker.h>
@@ -170,8 +169,6 @@
long realmem = 0;
long Maxmem = 0;
-struct bootinfo *bootinfo;
-
char machine[] = "powerpc";
SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, "");
@@ -186,7 +183,6 @@
SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_e500_startup, NULL);
void print_kernel_section_addr(void);
-void print_bootinfo(void);
void print_kenv(void);
u_int e500_init(u_int32_t, u_int32_t, void *);
@@ -260,22 +256,6 @@
}
void
-print_bootinfo(void)
-{
-
- debugf("bootinfo:\n");
- if (bootinfo == NULL) {
- debugf(" no bootinfo, null ptr\n");
- return;
- }
-
- debugf(" version = 0x%08x\n", bootinfo->bi_version);
- debugf(" ccsrbar = 0x%08x\n", bootinfo->bi_bar_base);
- debugf(" cpu_clk = 0x%08x\n", bootinfo->bi_cpu_clk);
- debugf(" bus_clk = 0x%08x\n", bootinfo->bi_bus_clk);
-}
-
-void
print_kernel_section_addr(void)
{
@@ -303,16 +283,12 @@
dtbp = (vm_offset_t)NULL;
/*
- * Parse metadata and fetch parameters. This must be done as the first
- * step as we need bootinfo data to at least init the console
+ * Parse metadata and fetch parameters.
*/
if (mdp != NULL) {
preload_metadata = mdp;
kmdp = preload_search_by_type("elf kernel");
if (kmdp != NULL) {
- bootinfo = (struct bootinfo *)preload_search_info(kmdp,
- MODINFO_METADATA | MODINFOMD_BOOTINFO);
-
boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int);
kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *);
dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t);
@@ -324,8 +300,7 @@
}
} else {
/*
- * We should scream but how? - without CCSR bar (in bootinfo)
- * cannot even output anything...
+ * We should scream but how? Cannot even output anything...
*/
/*
@@ -349,7 +324,7 @@
OF_interpret("perform-fixup", 0);
/* Initialize TLB1 handling */
- tlb1_init(bootinfo->bi_bar_base);
+ tlb1_init(fdt_immr_pa);
/* Reset Time Base */
mttb(0);
@@ -392,7 +367,6 @@
debugf(" dtbp = 0x%08x\n", (uint32_t)dtbp);
- print_bootinfo();
print_kernel_section_addr();
print_kenv();
//tlb1_print_entries();
==== //depot/projects/fdt/sys/powerpc/include/metadata.h#4 (text+ko) ====
@@ -32,7 +32,6 @@
#define MODINFOMD_ENVP 0x1001
#define MODINFOMD_HOWTO 0x1002
#define MODINFOMD_KERNEND 0x1003
-#define MODINFOMD_BOOTINFO 0x1004
-#define MODINFOMD_DTBP 0x1005
+#define MODINFOMD_DTBP 0x1004
#endif /* !_MACHINE_METADATA_H_ */
More information about the p4-projects
mailing list