Compare commits

...
Sign in to create a new pull request.

5 commits

Author SHA1 Message Date
Fedora Release Engineering
5044c966b9 dist-git conversion 2010-07-29 16:17:45 +00:00
Bill Nottingham
ff2d2401b7 Fix typo that causes a failure to update the common directory. (releng
#2781)
2009-11-26 01:12:02 +00:00
Roman Rakus
ad68db0a42 Fix maximum token length, to fix preupgrade. Resolves: #471321 2008-11-27 15:23:58 +00:00
David Woodhouse
8b12caa8c4 Fix Efika 2007-12-19 09:39:59 +00:00
Toshio くらとみ
64d9d52fbe Initialize branch F-8 for yaboot 2007-10-20 20:27:52 +00:00
6 changed files with 502 additions and 24 deletions

View file

View file

@ -1,22 +0,0 @@
# Makefile for source rpm: yaboot
# $Id: Makefile,v 1.2 2004/09/18 08:21:27 pnasrat Exp $
NAME := yaboot
SPECFILE = $(firstword $(wildcard *.spec))
UPSTREAM_CHECKS = sig
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attempt a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

336
efika.forth Normal file
View file

@ -0,0 +1,336 @@
\ 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@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

131
yaboot-1.3.13-bplan.patch Normal file
View file

@ -0,0 +1,131 @@
--- 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))

View file

@ -0,0 +1,12 @@
diff -up yaboot-1.3.14/second/cfg.c.bigger-max-token yaboot-1.3.14/second/cfg.c
--- yaboot-1.3.14/second/cfg.c.bigger-max-token 2008-11-12 14:39:11.000000000 -0500
+++ yaboot-1.3.14/second/cfg.c 2008-11-12 14:39:17.000000000 -0500
@@ -41,7 +41,7 @@ typedef struct {
void *data;
} CONFIG;
-#define MAX_TOKEN 200
+#define MAX_TOKEN 511
#define MAX_VAR_NAME MAX_TOKEN
#define EOF -1

View file

@ -1,10 +1,11 @@
Summary: Linux bootloader for Power Macintosh "New World" computers.
Name: yaboot
Version: 1.3.13
Release: 5%{?dist}
Release: 9%{?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,9 @@ Patch28: yaboot-1.3.13-multisata.patch
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
Patch33: yaboot-1.3.14-bigger-max-token.patch
URL: http://yaboot.ozlabs.org/
BuildRoot: %{_tmppath}/%{name}-root
Obsoletes: ybin
@ -81,6 +85,8 @@ yaboot can also bootload IBM pSeries machines.
%patch29 -p1 -b .bootwrite
%patch30 -p1 -b .addnote
%patch31 -p1 -b .firewire
%patch32 -p1 -b .bplan
%patch33 -p1 -b .maxtoken
%build
make VERSIONEXTRA='\ (Red Hat %version-%release)'
@ -89,7 +95,8 @@ make VERSIONEXTRA='\ (Red Hat %version-%release)'
%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 +104,7 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc COPYING README* doc/*
/boot/efika.forth
/sbin/ofpath
/sbin/ybin
/sbin/yabootconfig
@ -114,6 +122,19 @@ rm -rf $RPM_BUILD_ROOT
%ghost %config(noreplace) %{_sysconfdir}/yaboot.conf
%changelog
* Thu Nov 27 2008 Roman Rakus <rrakus@redhat.com> - 1.3.13-9
- Fix maximum token length, to fix preupgrade (#471321)
* Wed Nov 28 2007 David Woodhouse <dwmw2@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@redhat.com> - 1.3.13-7
- Add efika.forth for fixing up Efika device-tree
* Tue Nov 27 2007 David Woodhouse <dwmw2@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@redhat.com> - 1.3.13-5
- Rebuild