aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/boot')
-rw-r--r--arch/powerpc/boot/Makefile1
-rw-r--r--arch/powerpc/boot/addnote.c175
-rw-r--r--arch/powerpc/boot/dts/gef_sbc610.dts2
-rw-r--r--arch/powerpc/boot/dts/mpc8313erdb.dts39
-rw-r--r--arch/powerpc/boot/dts/mpc832x_rdb.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8349emitx.dts16
-rw-r--r--arch/powerpc/boot/dts/mpc8572ds.dts2
-rw-r--r--arch/powerpc/boot/libfdt/fdt_ro.c9
-rw-r--r--arch/powerpc/boot/main.c2
-rwxr-xr-xarch/powerpc/boot/wrapper9
10 files changed, 67 insertions, 192 deletions
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 8fc6d72849ae..3d3daa674299 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -41,6 +41,7 @@ $(obj)/4xx.o: BOOTCFLAGS += -mcpu=405
$(obj)/ebony.o: BOOTCFLAGS += -mcpu=405
$(obj)/cuboot-taishan.o: BOOTCFLAGS += -mcpu=405
$(obj)/cuboot-katmai.o: BOOTCFLAGS += -mcpu=405
+$(obj)/cuboot-acadia.o: BOOTCFLAGS += -mcpu=405
$(obj)/treeboot-walnut.o: BOOTCFLAGS += -mcpu=405
$(obj)/virtex405-head.o: BOOTAFLAGS += -mcpu=405
diff --git a/arch/powerpc/boot/addnote.c b/arch/powerpc/boot/addnote.c
index 3091d1d21aef..b1e5611b2ab1 100644
--- a/arch/powerpc/boot/addnote.c
+++ b/arch/powerpc/boot/addnote.c
@@ -11,12 +11,7 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Usage: addnote [-r realbase] zImage [note.elf]
- *
- * If note.elf is supplied, it is the name of an ELF file that contains
- * an RPA note to use instead of the built-in one. Alternatively, the
- * note.elf file may be empty, in which case the built-in RPA note is
- * used (this is to simplify how this is invoked from the wrapper script).
+ * Usage: addnote zImage
*/
#include <stdio.h>
#include <stdlib.h>
@@ -48,29 +43,27 @@ char rpaname[] = "IBM,RPA-Client-Config";
*/
#define N_RPA_DESCR 8
unsigned int rpanote[N_RPA_DESCR] = {
- 1, /* lparaffinity */
- 128, /* min_rmo_size */
+ 0, /* lparaffinity */
+ 64, /* min_rmo_size */
0, /* min_rmo_percent */
- 46, /* max_pft_size */
+ 40, /* max_pft_size */
1, /* splpar */
-1, /* min_load */
- 1, /* new_mem_def */
- 0, /* ignore_my_client_config */
+ 0, /* new_mem_def */
+ 1, /* ignore_my_client_config */
};
#define ROUNDUP(len) (((len) + 3) & ~3)
unsigned char buf[512];
-unsigned char notebuf[512];
-#define GET_16BE(b, off) (((b)[off] << 8) + ((b)[(off)+1]))
-#define GET_32BE(b, off) ((GET_16BE((b), (off)) << 16) + \
- GET_16BE((b), (off)+2))
+#define GET_16BE(off) ((buf[off] << 8) + (buf[(off)+1]))
+#define GET_32BE(off) ((GET_16BE(off) << 16) + GET_16BE((off)+2))
-#define PUT_16BE(b, off, v) ((b)[off] = ((v) >> 8) & 0xff, \
- (b)[(off) + 1] = (v) & 0xff)
-#define PUT_32BE(b, off, v) (PUT_16BE((b), (off), (v) >> 16), \
- PUT_16BE((b), (off) + 2, (v)))
+#define PUT_16BE(off, v) (buf[off] = ((v) >> 8) & 0xff, \
+ buf[(off) + 1] = (v) & 0xff)
+#define PUT_32BE(off, v) (PUT_16BE((off), (v) >> 16), \
+ PUT_16BE((off) + 2, (v)))
/* Structure of an ELF file */
#define E_IDENT 0 /* ELF header */
@@ -95,95 +88,25 @@ unsigned char notebuf[512];
unsigned char elf_magic[4] = { 0x7f, 'E', 'L', 'F' };
-unsigned char *read_rpanote(const char *fname, int *nnp)
-{
- int notefd, nr, i;
- int ph, ps, np;
- int note, notesize;
-
- notefd = open(fname, O_RDONLY);
- if (notefd < 0) {
- perror(fname);
- exit(1);
- }
- nr = read(notefd, notebuf, sizeof(notebuf));
- if (nr < 0) {
- perror("read note");
- exit(1);
- }
- if (nr == 0) /* empty file */
- return NULL;
- if (nr < E_HSIZE ||
- memcmp(&notebuf[E_IDENT+EI_MAGIC], elf_magic, 4) != 0 ||
- notebuf[E_IDENT+EI_CLASS] != ELFCLASS32 ||
- notebuf[E_IDENT+EI_DATA] != ELFDATA2MSB)
- goto notelf;
- close(notefd);
-
- /* now look for the RPA-note */
- ph = GET_32BE(notebuf, E_PHOFF);
- ps = GET_16BE(notebuf, E_PHENTSIZE);
- np = GET_16BE(notebuf, E_PHNUM);
- if (ph < E_HSIZE || ps < PH_HSIZE || np < 1)
- goto notelf;
-
- for (i = 0; i < np; ++i, ph += ps) {
- if (GET_32BE(notebuf, ph + PH_TYPE) != PT_NOTE)
- continue;
- note = GET_32BE(notebuf, ph + PH_OFFSET);
- notesize = GET_32BE(notebuf, ph + PH_FILESZ);
- if (notesize < 34 || note + notesize > nr)
- continue;
- if (GET_32BE(notebuf, note) != strlen(rpaname) + 1 ||
- GET_32BE(notebuf, note + 8) != 0x12759999 ||
- strcmp((char *)&notebuf[note + 12], rpaname) != 0)
- continue;
- /* looks like an RPA note, return it */
- *nnp = notesize;
- return &notebuf[note];
- }
- /* no RPA note found */
- return NULL;
-
- notelf:
- fprintf(stderr, "%s is not a big-endian 32-bit ELF image\n", fname);
- exit(1);
-}
-
int
main(int ac, char **av)
{
- int fd, n, i, ai;
+ int fd, n, i;
int ph, ps, np;
int nnote, nnote2, ns;
- unsigned char *rpap;
- char *p, *endp;
-
- ai = 1;
- if (ac >= ai + 2 && strcmp(av[ai], "-r") == 0) {
- /* process -r realbase */
- p = av[ai + 1];
- descr[1] = strtol(p, &endp, 16);
- if (endp == p || *endp != 0) {
- fprintf(stderr, "Can't parse -r argument '%s' as hex\n",
- p);
- exit(1);
- }
- ai += 2;
- }
- if (ac != ai + 1 && ac != ai + 2) {
- fprintf(stderr, "Usage: %s [-r realbase] elf-file [rpanote.elf]\n", av[0]);
+
+ if (ac != 2) {
+ fprintf(stderr, "Usage: %s elf-file\n", av[0]);
exit(1);
}
- fd = open(av[ai], O_RDWR);
+ fd = open(av[1], O_RDWR);
if (fd < 0) {
- perror(av[ai]);
+ perror(av[1]);
exit(1);
}
nnote = 12 + ROUNDUP(strlen(arch) + 1) + sizeof(descr);
nnote2 = 12 + ROUNDUP(strlen(rpaname) + 1) + sizeof(rpanote);
- rpap = NULL;
n = read(fd, buf, sizeof(buf));
if (n < 0) {
@@ -197,25 +120,22 @@ main(int ac, char **av)
if (buf[E_IDENT+EI_CLASS] != ELFCLASS32
|| buf[E_IDENT+EI_DATA] != ELFDATA2MSB) {
fprintf(stderr, "%s is not a big-endian 32-bit ELF image\n",
- av[ai]);
+ av[1]);
exit(1);
}
- if (ac == ai + 2)
- rpap = read_rpanote(av[ai + 1], &nnote2);
-
- ph = GET_32BE(buf, E_PHOFF);
- ps = GET_16BE(buf, E_PHENTSIZE);
- np = GET_16BE(buf, E_PHNUM);
+ ph = GET_32BE(E_PHOFF);
+ ps = GET_16BE(E_PHENTSIZE);
+ np = GET_16BE(E_PHNUM);
if (ph < E_HSIZE || ps < PH_HSIZE || np < 1)
goto notelf;
if (ph + (np + 2) * ps + nnote + nnote2 > n)
goto nospace;
for (i = 0; i < np; ++i) {
- if (GET_32BE(buf, ph + PH_TYPE) == PT_NOTE) {
+ if (GET_32BE(ph + PH_TYPE) == PT_NOTE) {
fprintf(stderr, "%s already has a note entry\n",
- av[ai]);
+ av[1]);
exit(0);
}
ph += ps;
@@ -228,42 +148,37 @@ main(int ac, char **av)
/* fill in the program header entry */
ns = ph + 2 * ps;
- PUT_32BE(buf, ph + PH_TYPE, PT_NOTE);
- PUT_32BE(buf, ph + PH_OFFSET, ns);
- PUT_32BE(buf, ph + PH_FILESZ, nnote);
+ PUT_32BE(ph + PH_TYPE, PT_NOTE);
+ PUT_32BE(ph + PH_OFFSET, ns);
+ PUT_32BE(ph + PH_FILESZ, nnote);
/* fill in the note area we point to */
/* XXX we should probably make this a proper section */
- PUT_32BE(buf, ns, strlen(arch) + 1);
- PUT_32BE(buf, ns + 4, N_DESCR * 4);
- PUT_32BE(buf, ns + 8, 0x1275);
+ PUT_32BE(ns, strlen(arch) + 1);
+ PUT_32BE(ns + 4, N_DESCR * 4);
+ PUT_32BE(ns + 8, 0x1275);
strcpy((char *) &buf[ns + 12], arch);
ns += 12 + strlen(arch) + 1;
for (i = 0; i < N_DESCR; ++i, ns += 4)
- PUT_32BE(buf, ns, descr[i]);
+ PUT_32BE(ns, descr[i]);
/* fill in the second program header entry and the RPA note area */
ph += ps;
- PUT_32BE(buf, ph + PH_TYPE, PT_NOTE);
- PUT_32BE(buf, ph + PH_OFFSET, ns);
- PUT_32BE(buf, ph + PH_FILESZ, nnote2);
+ PUT_32BE(ph + PH_TYPE, PT_NOTE);
+ PUT_32BE(ph + PH_OFFSET, ns);
+ PUT_32BE(ph + PH_FILESZ, nnote2);
/* fill in the note area we point to */
- if (rpap) {
- /* RPA note supplied in file, just copy the whole thing over */
- memcpy(buf + ns, rpap, nnote2);
- } else {
- PUT_32BE(buf, ns, strlen(rpaname) + 1);
- PUT_32BE(buf, ns + 4, sizeof(rpanote));
- PUT_32BE(buf, ns + 8, 0x12759999);
- strcpy((char *) &buf[ns + 12], rpaname);
- ns += 12 + ROUNDUP(strlen(rpaname) + 1);
- for (i = 0; i < N_RPA_DESCR; ++i, ns += 4)
- PUT_32BE(buf, ns, rpanote[i]);
- }
+ PUT_32BE(ns, strlen(rpaname) + 1);
+ PUT_32BE(ns + 4, sizeof(rpanote));
+ PUT_32BE(ns + 8, 0x12759999);
+ strcpy((char *) &buf[ns + 12], rpaname);
+ ns += 12 + ROUNDUP(strlen(rpaname) + 1);
+ for (i = 0; i < N_RPA_DESCR; ++i, ns += 4)
+ PUT_32BE(ns, rpanote[i]);
/* Update the number of program headers */
- PUT_16BE(buf, E_PHNUM, np + 2);
+ PUT_16BE(E_PHNUM, np + 2);
/* write back */
lseek(fd, (long) 0, SEEK_SET);
@@ -273,18 +188,18 @@ main(int ac, char **av)
exit(1);
}
if (i < n) {
- fprintf(stderr, "%s: write truncated\n", av[ai]);
+ fprintf(stderr, "%s: write truncated\n", av[1]);
exit(1);
}
exit(0);
notelf:
- fprintf(stderr, "%s does not appear to be an ELF file\n", av[ai]);
+ fprintf(stderr, "%s does not appear to be an ELF file\n", av[1]);
exit(1);
nospace:
fprintf(stderr, "sorry, I can't find space in %s to put the note\n",
- av[ai]);
+ av[1]);
exit(1);
}
diff --git a/arch/powerpc/boot/dts/gef_sbc610.dts b/arch/powerpc/boot/dts/gef_sbc610.dts
index 6ed608322ddc..e48cfa740c8a 100644
--- a/arch/powerpc/boot/dts/gef_sbc610.dts
+++ b/arch/powerpc/boot/dts/gef_sbc610.dts
@@ -108,7 +108,7 @@
compatible = "simple-bus";
ranges = <0x0 0xfef00000 0x00100000>;
reg = <0xfef00000 0x100000>; // CCSRBAR 1M
- bus-frequency = <0>;
+ bus-frequency = <33333333>;
i2c1: i2c@3000 {
#address-cells = <1>;
diff --git a/arch/powerpc/boot/dts/mpc8313erdb.dts b/arch/powerpc/boot/dts/mpc8313erdb.dts
index 747f27676332..503031766825 100644
--- a/arch/powerpc/boot/dts/mpc8313erdb.dts
+++ b/arch/powerpc/boot/dts/mpc8313erdb.dts
@@ -164,45 +164,6 @@
mode = "cpu";
};
- dma@82a8 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "fsl,mpc8313-dma", "fsl,elo-dma";
- reg = <0x82a8 4>;
- ranges = <0 0x8100 0x1a8>;
- interrupt-parent = <&ipic>;
- interrupts = <71 8>;
- cell-index = <0>;
- dma-channel@0 {
- compatible = "fsl,mpc8313-dma-channel", "fsl,elo-dma-channel";
- reg = <0 0x80>;
- cell-index = <0>;
- interrupt-parent = <&ipic>;
- interrupts = <71 8>;
- };
- dma-channel@80 {
- compatible = "fsl,mpc8313-dma-channel", "fsl,elo-dma-channel";
- reg = <0x80 0x80>;
- cell-index = <1>;
- interrupt-parent = <&ipic>;
- interrupts = <71 8>;
- };
- dma-channel@100 {
- compatible = "fsl,mpc8313-dma-channel", "fsl,elo-dma-channel";
- reg = <0x100 0x80>;
- cell-index = <2>;
- interrupt-parent = <&ipic>;
- interrupts = <71 8>;
- };
- dma-channel@180 {
- compatible = "fsl,mpc8313-dma-channel", "fsl,elo-dma-channel";
- reg = <0x180 0x28>;
- cell-index = <3>;
- interrupt-parent = <&ipic>;
- interrupts = <71 8>;
- };
- };
-
/* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */
usb@23000 {
compatible = "fsl-usb2-dr";
diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index 226ff066652b..dea30910c136 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -18,8 +18,8 @@
#size-cells = <1>;
aliases {
- ethernet0 = &enet0;
- ethernet1 = &enet1;
+ ethernet0 = &enet1;
+ ethernet1 = &enet0;
serial0 = &serial0;
serial1 = &serial1;
pci0 = &pci0;
diff --git a/arch/powerpc/boot/dts/mpc8349emitx.dts b/arch/powerpc/boot/dts/mpc8349emitx.dts
index 2c9d54a35bc3..4bdbaf4993a1 100644
--- a/arch/powerpc/boot/dts/mpc8349emitx.dts
+++ b/arch/powerpc/boot/dts/mpc8349emitx.dts
@@ -91,6 +91,14 @@
interrupts = <18 0x8>;
interrupt-parent = <&ipic>;
};
+
+ mcu_pio: mcu@a {
+ #gpio-cells = <2>;
+ compatible = "fsl,mc9s08qg8-mpc8349emitx",
+ "fsl,mcu-mpc8349emitx";
+ reg = <0x0a>;
+ gpio-controller;
+ };
};
spi@7000 {
@@ -139,14 +147,6 @@
interrupt-parent = <&ipic>;
interrupts = <71 8>;
};
-
- mcu_pio: mcu@a {
- #gpio-cells = <2>;
- compatible = "fsl,mc9s08qg8-mpc8349emitx",
- "fsl,mcu-mpc8349emitx";
- reg = <0x0a>;
- gpio-controller;
- };
};
usb@22000 {
diff --git a/arch/powerpc/boot/dts/mpc8572ds.dts b/arch/powerpc/boot/dts/mpc8572ds.dts
index cadd4652a695..5c69b2fafd32 100644
--- a/arch/powerpc/boot/dts/mpc8572ds.dts
+++ b/arch/powerpc/boot/dts/mpc8572ds.dts
@@ -90,7 +90,7 @@
compatible = "fsl,mpc8572-l2-cache-controller";
reg = <0x20000 0x1000>;
cache-line-size = <32>; // 32 bytes
- cache-size = <0x80000>; // L2, 512K
+ cache-size = <0x100000>; // L2, 1M
interrupt-parent = <&mpic>;
interrupts = <16 2>;
};
diff --git a/arch/powerpc/boot/libfdt/fdt_ro.c b/arch/powerpc/boot/libfdt/fdt_ro.c
index 129b532bcc1a..fbbba44fcd0d 100644
--- a/arch/powerpc/boot/libfdt/fdt_ro.c
+++ b/arch/powerpc/boot/libfdt/fdt_ro.c
@@ -104,8 +104,8 @@ int fdt_subnode_offset_namelen(const void *fdt, int offset,
FDT_CHECK_HEADER(fdt);
- for (depth = 0;
- offset >= 0;
+ for (depth = 0, offset = fdt_next_node(fdt, offset, &depth);
+ (offset >= 0) && (depth > 0);
offset = fdt_next_node(fdt, offset, &depth)) {
if (depth < 0)
return -FDT_ERR_NOTFOUND;
@@ -114,7 +114,10 @@ int fdt_subnode_offset_namelen(const void *fdt, int offset,
return offset;
}
- return offset; /* error */
+ if (offset < 0)
+ return offset; /* error */
+ else
+ return -FDT_ERR_NOTFOUND;
}
int fdt_subnode_offset(const void *fdt, int parentoffset,
diff --git a/arch/powerpc/boot/main.c b/arch/powerpc/boot/main.c
index ae32801ebd69..a28f02165e97 100644
--- a/arch/powerpc/boot/main.c
+++ b/arch/powerpc/boot/main.c
@@ -63,7 +63,7 @@ static struct addr_range prep_kernel(void)
*/
if ((unsigned long)_start < ei.loadsize)
fatal("Insufficient memory for kernel at address 0!"
- " (_start=%p, uncomressed size=%08x)\n\r",
+ " (_start=%p, uncompressed size=%08lx)\n\r",
_start, ei.loadsize);
if ((unsigned long)_end < ei.memsize)
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index f39073511a49..965c237c122d 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -306,13 +306,8 @@ fi
# post-processing needed for some platforms
case "$platform" in
-pseries)
- ${CROSS}objcopy -O binary -j .fakeelf "$kernel" "$ofile".rpanote
- $objbin/addnote "$ofile" "$ofile".rpanote
- rm -r "$ofile".rpanote
- ;;
-chrp)
- $objbin/addnote -r c00000 "$ofile"
+pseries|chrp)
+ $objbin/addnote "$ofile"
;;
coff)
${CROSS}objcopy -O aixcoff-rs6000 --set-start "$entry" "$ofile"