Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Dec 2009 19:48:49 GMT
From:      Rafal Jaworowski <raj@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 171297 for review
Message-ID:  <200912021948.nB2JmnOc022623@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/chv.cgi?CH=171297

Change 171297 by raj@raj_fdt on 2009/12/02 19:48:47

	Connect FDT ofw I/F back-end to the build.
	
	This gives us an FDT-enabled MPC85XX kernel featuring /dev/openfirm
	charcter device, accessible from user space.
	
	For more details and examples see
	http://wiki.freebsd.org/FlattenedDeviceTree/kernel

Affected files ...

.. //depot/projects/fdt/sys/conf/files.powerpc#3 edit
.. //depot/projects/fdt/sys/powerpc/booke/machdep.c#2 edit

Differences ...

==== //depot/projects/fdt/sys/conf/files.powerpc#3 (text+ko) ====

@@ -33,13 +33,14 @@
 dev/fb/fb.c			optional	sc
 dev/hwpmc/hwpmc_powerpc.c	optional	hwpmc
 dev/kbd/kbd.c			optional	sc
-dev/ofw/openfirm.c		optional	aim
-dev/ofw/openfirmio.c		optional	aim
-dev/ofw/ofw_bus_if.m		optional	aim
-dev/ofw/ofw_if.m		optional	aim
-dev/ofw/ofw_bus_subr.c		optional	aim
+dev/ofw/openfirm.c		optional	aim | fdt
+dev/ofw/openfirmio.c		optional	aim | fdt
+dev/ofw/ofw_bus_if.m		optional	aim | fdt
+dev/ofw/ofw_if.m		optional	aim | fdt
+dev/ofw/ofw_bus_subr.c		optional	aim | fdt
 dev/ofw/ofw_console.c		optional	aim
 dev/ofw/ofw_disk.c		optional	ofwd aim
+dev/ofw/ofw_fdt.c		optional	fdt
 dev/ofw/ofw_iicbus.c		optional	iicbus aim
 dev/ofw/ofw_standard.c		optional	aim
 dev/powermac_nvram/powermac_nvram.c optional	powermac_nvram powermac

==== //depot/projects/fdt/sys/powerpc/booke/machdep.c#2 (text+ko) ====

@@ -135,6 +135,8 @@
 #include <sys/linker.h>
 #include <sys/reboot.h>
 
+#include <dev/ofw/openfirm.h>
+
 #include <powerpc/mpc85xx/ocpbus.h>
 #include <powerpc/mpc85xx/mpc85xx.h>
 
@@ -334,12 +336,13 @@
 {
 	struct pcpu *pc;
 	void *kmdp;
-	vm_offset_t end;
+	vm_offset_t end, dtbp;
 	uint32_t csr;
 
 	kmdp = NULL;
 
 	end = endkernel;
+	dtbp = (vm_offset_t)NULL;
 
 	/*
 	 * Parse metadata and fetch parameters. This must be done as the first
@@ -354,6 +357,7 @@
 
 			boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int);
 			kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *);
+			dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t);
 			end = MD_FETCH(kmdp, MODINFOMD_KERNEND, vm_offset_t);
 #ifdef DDB
 			ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t);
@@ -372,9 +376,15 @@
 		  * restore everything as the TLB have all been reprogrammed
 		  * in the locore etc...)
 		  */
-		while(1);
+		while (1);
 	}
 
+	if (OF_install(OFW_FDT, 0) == FALSE)
+		while (1);
+
+	if (OF_init((void *)dtbp) != 0)
+		while (1);
+
 	/* Initialize TLB1 handling */
 	tlb1_init(bootinfo->bi_bar_base);
 
@@ -417,6 +427,8 @@
 	csr = ccsr_read4(OCP85XX_L2CTL);
 	debugf(" L2CTL = 0x%08x\n", csr);
 
+	printf(" dtbp = 0x%08x\n", (uint32_t)dtbp);
+
 	print_bootinfo();
 	print_kernel_section_addr();
 	print_kenv();



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912021948.nB2JmnOc022623>