rpms/yaboot/F-8 efika.forth, NONE, 1.1 yaboot-1.3.13-bplan.patch, NONE, 1.1 yaboot.spec, 1.41, 1.42

David Woodhouse (dwmw2) fedora-extras-commits at redhat.com
Wed Dec 19 09:40:37 UTC 2007


Author: dwmw2

Update of /cvs/pkgs/rpms/yaboot/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv2764

Modified Files:
	yaboot.spec 
Added Files:
	efika.forth yaboot-1.3.13-bplan.patch 
Log Message:
Fix Efika


--- NEW FILE efika.forth ---
\ FORTH

." Efika 5200B Device Tree Supplement 20071114" cr
." (c) 2007 Genesi USA, Inc." cr 
." http://www.powerdeveloper.org/ for support" cr cr

\ headerless

s" /openprom" find-device
	d# 20071114 encode-int s" device-tree-version" property
device-end

s" /builtin/ata" find-device 
	s" mpc5200-ata" encode-string
	s" mpc5200b-ata" encode-string encode+
	s" compatible" property
device-end

s" /builtin/sound" find-device
	s" mpc5200-psc-ac97" encode-string
	s" mpc5200b-psc-ac97" encode-string encode+
	s" compatible" property

	0x2 encode-int
	0x2 encode-int encode+
	0x3 encode-int encode+
	s" interrupts" property

	\ Audio is on PSC2, just for informational purposes
	1 encode-int s" cell-index" property
device-end

\ Quick test to see if AC97 is enabled
0xf0000b00 dup dup l@ 0x20 and
0= if
	." Enabling AC97" cr
	dup l@ 0x20 or
	swap l!
else
	drop
then

\ SRAM compatibles
s" /builtin/sram" find-device
	s" mpc5200-sram" encode-string
	s" mpc5200b-sram" encode-string encode+
	s" compatible" property
	
	s" sram" device-type \ this is a contentious one
device-end

\ PIC compatibles
s" /builtin/pic" find-device
	s" mpc5200-pic" encode-string
	s" mpc5200b-pic" encode-string encode+
	s" compatible" property
device-end

\ Serial compatibles. Also fix cell-index and port-number as per bindings
s" /builtin/serial" find-device
	s" mpc5200-psc-uart" encode-string
	s" mpc5200b-psc-uart" encode-string encode+
	s" compatible" property
	
	\ Serial port is PSC1 for informational purposes, Linux 0-indexes it
	0 encode-int s" cell-index" property
	\ Since this is the main, always there, preferred serial port..
	0 encode-int s" port-number" property
device-end

\ Ethernet compatibles
s" /builtin/ethernet" find-device
	s" mpc5200-fec" encode-string
	s" mpc5200b-fec" encode-string encode+
	s" compatible" property
device-end

\ BestComm compatibles, interrupt mess
s" /builtin/bestcomm" find-device
	s" mpc5200-bestcomm" encode-string
	s" mpc5200b-bestcomm" encode-string
	encode+
	s" compatible" property
		
	\ make 16 interrupt property in a batch. We have to do the first one by
	\ hand simply because of the way encode+ works.

	0x3 encode-int 0x0 encode-int 0x3 encode-int encode+ encode+
	0x10 1 do 
		0x3 encode-int encode+ i encode-int encode+ 0x3 encode-int encode+
	loop
	
	\ now we can store the damn thing
	s" interrupts" property
device-end

\ New USB binding - change one of the numbers here to disable it for older kernels
\ as this is a destructive change
0 1 = if
s" /builtin/usb" find-device
	s" usb-ohci" device-type
	s" " encode-string s" big-endian" property

	s" mpc5200-ohci" encode-string
	s" mpc5200-usb-ohci" encode-string encode+
	s" compatible" property
device-end
then

\ Go into the root node and kill off any mention of CHRP
s" /" find-device
	s" efika" device-type
	s" Efika 5200B" encode-string s" CODEGEN,board" property
	s" Efika 5200B PowerPC System" encode-string s" CODEGEN,description" property
device-end

\ Fix the /builtin device-type for Linux
s" /builtin" find-device
	s" soc" device-type
device-end

\ ADDING NEW ENTRIES TO THE DEVICE TREE
\
\ Clock Distribution Module - need this to change baud rates etc. and turn off
\ clocks for power management. Useful little thing. Needs an entry to find the
\ address without guessing (in case they change it in the 512X)

\ Clock Distribution Module
." Adding Clock Distribution Module" cr

s" /builtin" find-device
new-device
	" cdm" 2dup device-name device-type
	" MPC52xx Clock Distribution Module" encode-string " .description" property
	0xf0000200 0x38 reg

	" mpc5200-cdm" encode-string 
	" mpc5200b-cdm" encode-string
	encode+
	" compatible" property

finish-device

\ GPIO (Simple) Module
." Adding Simple GPIO Module" cr

s" /builtin" find-device
new-device
	s" gpio" 2dup device-name device-type
	s" MPC52xx Simple GPIO" encode-string s" .description" property
	0xf0000b00 0x40 reg

	s" mpc5200-gpio" encode-string
	s" mpc5200b-gpio" encode-string encode+ 
	s" compatible" property

	0x10000000 encode-int s" gpio-mask" property

	0x1 encode-int
	0x7 encode-int
	0x3 encode-int
	encode+ encode+
	s" interrupts" property
finish-device

\ GPIO (Wakeup) Module
." Adding Wakeup GPIO Module" cr

s" /builtin" find-device
new-device
	s" gpio-wkup" 2dup device-name device-type
	s" MPC52xx Wakeup GPIO" encode-string s" .description" property
	0xf0000c00 0x28 reg

	s" mpc5200-gpio-wkup" encode-string
	s" mpc5200b-gpio-wkup" encode-string
	encode+
	s" compatible" property
	
	0x30000000 encode-int s" gpio-mask" property

	0x1 encode-int
	0x8 encode-int encode+
	0x3 encode-int encode+
	0x1 encode-int encode+
	0x3 encode-int encode+
	0x3 encode-int encode+
	s" interrupts" property
finish-device

\
\ High resolution (General Purpose and Slice) Timers
\
\ We ignore slice timer 0 since critical interrupt handling in Linux
\ is curiously missing
." Adding Slice Timer 1" cr

s" /builtin" find-device
new-device
	s" slt" 2dup device-name device-type
	s" MPC52xx Slice Timer 1" encode-string " .description" property
	0xf0000710 0x10 reg
	
	s" mpc5200-slt" encode-string 
	s" mpc5200b-slt" encode-string
	encode+
	s" compatible" property

	1 encode-int " cell-index" property

	\ The interrupt listed here is probably wrong
	0x1 encode-int
	0x0 encode-int encode+
	0x3 encode-int encode+ 
	s" interrupts" property
finish-device

\ Add all the GPTs to the device-tree
\ : gpt-add ( gpt-id -- )
\ depth                  
\ 1 > if                 
8 0 do i
	dup 7 <= if    
		dup    
		0x9 +  
		swap dup
		0x10 *  
		0xf0000600 +
		swap dup    

		." Adding General Purpose Timer " .d cr 

 		s" /builtin" find-device
		new-device
		
		s" gpt" 2dup device-name device-type   
		swap 0x10 reg                      

		encode-int s" cell-index" property   
		
		s" MPC52xx General Purpose Timer X"
		2dup + 1 -  		\ get the character position of the X
		0x30 i + swap c! 	\ store ascii character of timer number
		encode-string s" .description" property
		
		s" mpc5200-gpt" encode-string
		s" mpc5200b-gpt" encode-string encode+
		s" fsl,mpc5200-gpt" encode-string encode+
		s" fsl,mpc5200b-gpt" encode-string encode+ 
		s" compatible" property
		
		0x1 encode-int                        
		2 pick encode-int encode+			
		0x3 encode-int encode+
		s" interrupts" property
		
		finish-device
	then
loop
\ then
\ ;

\ Add watchdog marker to GPT0
s" /builtin/gpt at f0000600" find-device
	s" " encode-string s" has-wdt" property
	s" " encode-string s" fsl,has-wdt" property
device-end

\ PHY for ethernet. Thanks to Domen Puncer for this.
." Adding Ethernet PHY" cr

s" /builtin" find-device
new-device
	1 encode-int s" #address-cells" property
	0 encode-int s" #size-cells" property
	s" mdio" 2dup device-name device-type
	s" mpc5200b-fec-phy" encode-string s" compatible" property
	0xf0003000 0x400 reg

	0x2 encode-int
	0x5 encode-int encode+
	0x3 encode-int encode+
	s" interrupts" property

	new-device
		s" ethernet-phy" 2dup device-name device-type
		0x10 encode-int s" reg" property

		my-self		\ save our phandle to stack
		ihandle>phandle
	finish-device
finish-device

s" /builtin/ethernet" find-device
	encode-int		\ phy's phandle
	s" phy-handle" property
device-end

\
\ HERE BE DRAGONS

\ SDRAM Controller (needed to enter deep sleep and turn off RAM clocks)
." Adding SDRAM Controller" cr

s" /builtin" find-device
new-device
	s" sdram" device-name
	s" memory-controller" device-type

	0xf0000100 0x10 reg

	s" MPC52xx SDRAM Memory Controller" encode-string s" .description" property	
	
	s" mpc5200b-sdram" encode-string
	s" mpc5200-sdram" encode-string encode+
	s" compatible" property
finish-device	

\ XLB Arbiter (pipeline/bestcomm stuff enabled here)
." Adding XLB Arbiter" cr

s" /builtin" find-device
new-device
	s" xlb" 2dup device-name device-type

	0xf0001f00 0x100 reg

	s" MPC52xx XLB Arbiter" encode-string s" .description" property	
	
	s" mpc5200-xlb" encode-string
	s" mpc5200b-xlb" encode-string encode+
	s" compatible" property
finish-device

\ Optionally uncomment and boot your Linux
\ s" hd:0 vmlinuz console= blah=" $boot

yaboot-1.3.13-bplan.patch:

--- NEW FILE yaboot-1.3.13-bplan.patch ---
--- yaboot-1.3.13/include/bootinfo.h.nocolonzero	2001-12-01 09:58:10.000000000 +0000
+++ yaboot-1.3.13/include/bootinfo.h	2007-11-27 17:17:28.000000000 +0000
@@ -34,6 +34,7 @@
 #define _MACH_classic	0x00000400	/* RPCG RPX-Classic 8xx board */
 #define _MACH_oak	0x00000800	/* IBM "Oak" 403 eval. board */
 #define _MACH_walnut	0x00001000	/* IBM "Walnut" 405GP eval. board */
+#define _MACH_bplan	0x00002000	/* Pegasos/Efika, broken partition #s */
 
 struct bi_record {
      unsigned long tag;			/* tag ID */
@@ -51,6 +52,8 @@ struct bi_record {
 
 #endif /* _PPC_BOOTINFO_H */
 
+extern int _machine;
+
 /* 
  * Local variables:
  * c-file-style: "k&r"
--- yaboot-1.3.13/second/fs_ext2.c.nocolonzero	2007-11-27 17:16:21.000000000 +0000
+++ yaboot-1.3.13/second/fs_ext2.c	2007-11-27 17:17:43.000000000 +0000
@@ -35,6 +35,7 @@
 #include "fs.h"
 #include "errors.h"
 #include "debug.h"
+#include "bootinfo.h"
 
 #define FAST_VERSION
 #define MAX_READ_RANGE	256
@@ -159,7 +160,8 @@ ext2_open(	struct boot_file_t*	file,
 
      /* Open the OF device for the entire disk */
      strncpy(buffer, dev_name, 1020);
-     strcat(buffer, ":0");
+     if (_machine != _MACH_bplan)
+	  strcat(buffer, ":0");
 
      DEBUG_F("<%s>\n", buffer);
 
--- yaboot-1.3.13/second/fs_reiserfs.c.nocolonzero	2001-12-01 09:58:10.000000000 +0000
+++ yaboot-1.3.13/second/fs_reiserfs.c	2007-11-27 17:18:14.000000000 +0000
@@ -29,6 +29,7 @@
 #include "fs.h"
 #include "errors.h"
 #include "debug.h"
+#include "bootinfo.h"
 #include "reiserfs/reiserfs.h"
 
 /* Exported in struct fs_t */
@@ -84,7 +85,10 @@ reiserfs_open( struct boot_file_t *file,
      else
 	  INFO->partition_offset = 0;
 
-     sprintf( buffer, "%s:%d", dev_name, 0 ); /* 0 is full disk in OF */
+     strncpy(buffer, dev_name, 1020);
+     if (_machine != _MACH_bplan)
+	  strcat(buffer, ":0");  /* 0 is full disk in (non-buggy) OF */
+
      file->of_device = prom_open( buffer );
      DEBUG_F( "Trying to open dev_name=%s; filename=%s; partition offset=%Lu\n",
 	      buffer, file_name, INFO->partition_offset );
--- yaboot-1.3.13/second/fs_xfs.c.nocolonzero	2002-09-15 04:12:21.000000000 +0100
+++ yaboot-1.3.13/second/fs_xfs.c	2007-11-27 17:17:57.000000000 +0000
@@ -30,6 +30,7 @@
 #include "xfs/xfs.h"
 #include "errors.h"
 #include "debug.h"
+#include "bootinfo.h"
 
 #define SECTOR_BITS 9
 
@@ -77,7 +78,9 @@ xfs_open(struct boot_file_t *file, const
 	else
 		partition_offset = 0;
 
-	sprintf(buffer, "%s:%d", dev_name, 0); /* 0 is full disk in OF */
+	strncpy(buffer, dev_name, 1020);
+	if (_machine != _MACH_bplan)
+		strcat(buffer, ":0");  /* 0 is full disk in (non-buggy) OF */
 	DEBUG_F("Trying to open dev_name=%s; filename=%s; partition offset=%Lu\n",
 		buffer, file_name, partition_offset);
 	file->of_device = prom_open(buffer);
--- yaboot-1.3.13/second/partition.c.nocolonzero	2007-11-27 17:16:21.000000000 +0000
+++ yaboot-1.3.13/second/partition.c	2007-11-27 17:17:16.000000000 +0000
@@ -40,6 +40,7 @@
 #include "linux/iso_fs.h"
 #include "debug.h"
 #include "errors.h"
+#include "bootinfo.h"
 
 /* We currently don't check the partition type, some users
  * are putting crap there and still expect it to work...
@@ -337,7 +338,8 @@ partitions_lookup(const char *device)
      unsigned int prom_blksize, iso_root_block;
 	
      strncpy(block_buffer, device, 2040);
-     strcat(block_buffer, ":0");
+     if (_machine != _MACH_bplan)
+	  strcat(block_buffer, ":0");
 	
      /* Open device */
      disk = prom_open(block_buffer);
--- yaboot-1.3.13/second/yaboot.c.nocolonzero	2007-11-27 17:16:21.000000000 +0000
+++ yaboot-1.3.13/second/yaboot.c	2007-11-27 17:16:21.000000000 +0000
@@ -222,7 +222,10 @@ yaboot_start (unsigned long r3, unsigned
      root = prom_finddevice("/");
      if (root != 0) {
 	  static char model[256];
-	  if (prom_getprop(root, "device_type", model, 256 ) > 0 &&
+	  if (prom_getprop(root, "CODEGEN,vendor", model, 256) > 0 &&
+	      !strncmp("bplan", model, 5))
+	       _machine = _MACH_bplan;
+	  else if (prom_getprop(root, "device_type", model, 256 ) > 0 &&
 	      !strncmp("chrp", model, 4))
 	       _machine = _MACH_chrp;
 	  else {
@@ -1486,11 +1489,13 @@ yaboot_main(void)
 	  prom_printf("%s: Unable to parse\n", bootdevice);
 	  return -1;
      }
+     if (_machine == _MACH_bplan)
+	  boot.part++;
      DEBUG_F("After parse_device_path: dev=%s, part=%d, file=%s\n",
 	     boot.dev, boot.part, boot.file);
 
      if (!conf_given) {
-	  if (_machine == _MACH_chrp)
+	  if (_machine == _MACH_chrp || _machine == _MACH_bplan)
 	       boot.file = "/etc/";
 	  else if (strlen(boot.file)) {
 	       if (!strncmp(boot.file, "\\\\", 2))


Index: yaboot.spec
===================================================================
RCS file: /cvs/pkgs/rpms/yaboot/F-8/yaboot.spec,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- yaboot.spec	21 Aug 2007 18:42:44 -0000	1.41
+++ yaboot.spec	19 Dec 2007 09:39:59 -0000	1.42
@@ -1,10 +1,11 @@
 Summary: Linux bootloader for Power Macintosh "New World" computers.
 Name: yaboot
 Version: 1.3.13
-Release: 5%{?dist}
+Release: 8%{?dist}
 License: GPL
 Group: System Environment/Base
 Source: http://yaboot.ozlabs.org/releases/yaboot-%{version}.tar.gz
+Source1: efika.forth
 Patch1: yaboot-1.3.3-man.patch
 Patch2: yaboot-1.3.6-ofboot.patch
 Patch3: yaboot-1.3.6-rh.patch
@@ -36,6 +37,8 @@
 Patch29: yaboot-1.3.13-dontwritehome.patch
 Patch30: yaboot-1.3.12-addnote.patch
 Patch31: yaboot-1.3.13-ofpath-firewire-usb.patch
+Patch32: yaboot-1.3.13-bplan.patch
+
 URL: http://yaboot.ozlabs.org/
 BuildRoot: %{_tmppath}/%{name}-root
 Obsoletes: ybin
@@ -81,6 +84,7 @@
 %patch29 -p1 -b .bootwrite
 %patch30 -p1 -b .addnote
 %patch31 -p1 -b .firewire
+%patch32 -p1 -b .bplan
 
 %build
 make VERSIONEXTRA='\ (Red Hat %version-%release)'
@@ -89,7 +93,8 @@
 %makeinstall ROOT=$RPM_BUILD_ROOT PREFIX=%{_prefix} MANDIR=share/man SBINDIR=/sbin
 rm -f $RPM_BUILD_ROOT/etc/yaboot.conf
 touch $RPM_BUILD_ROOT/etc/yaboot.conf
-
+mkdir -p $RPM_BUILD_ROOT/boot
+install -m0644 %{SOURCE1} $RPM_BUILD_ROOT/boot/efika.forth
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -97,6 +102,7 @@
 %files
 %defattr(-,root,root)
 %doc COPYING README* doc/*
+/boot/efika.forth
 /sbin/ofpath
 /sbin/ybin
 /sbin/yabootconfig
@@ -114,6 +120,16 @@
 %ghost %config(noreplace) %{_sysconfdir}/yaboot.conf
 
 %changelog
+* Wed Nov 28 2007 David Woodhouse <dwmw2 at redhat.com> - 1.3.13-8
+- Correct default config file location on Efika
+- Disable new USB bindings in efika.forth for now
+
+* Tue Nov 27 2007 David Woodhouse <dwmw2 at redhat.com> - 1.3.13-7
+- Add efika.forth for fixing up Efika device-tree
+
+* Tue Nov 27 2007 David Woodhouse <dwmw2 at redhat.com> - 1.3.13-6
+- Detect broken bplan firmware and don't add ":0" to block device names
+
 * Tue Aug 21 2007 David Cantrell <dcantrell at redhat.com> - 1.3.13-5
 - Rebuild
 




More information about the scm-commits mailing list