Commit f348ef4e authored by Paul Mackerras's avatar Paul Mackerras

PPC32: Makefile and other fixes for the boot wrappers.

parent ad9456b1
......@@ -56,8 +56,6 @@ drivers-$(CONFIG_8xx) += arch/ppc/8xx_io/
drivers-$(CONFIG_4xx) += arch/ppc/4xx_io/
drivers-$(CONFIG_8260) += arch/ppc/8260_io/
makeboot =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/ppc/boot $(1)
BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd pImage vmlinux.sm
.PHONY: $(BOOT_TARGETS) clean archclean archmrproper
......@@ -70,14 +68,14 @@ AFLAGS_vmlinux.lds.o := -Upowerpc
bzImage: zImage
$(BOOT_TARGETS): vmlinux
@$(call makeboot,$@)
$(Q)$(MAKE) $(build)=arch/ppc/boot $@
%_config: arch/ppc/configs/%_defconfig
rm -f .config arch/ppc/defconfig
cp -f arch/ppc/configs/$(@:config=defconfig) .config
archclean:
+$(MAKE) -f scripts/Makefile.clean obj=arch/ppc/boot
$(Q)$(MAKE) $(clean)=arch/ppc/boot
archmrproper:
......
......@@ -11,6 +11,7 @@
#
CFLAGS += -fno-builtin -D__BOOTER__ -Iarch/$(ARCH)/boot/include
HOSTCFLAGS += -I$(TOPDIR)/arch/$(ARCH)/boot/include
BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd
......@@ -41,5 +42,6 @@ host-progs := $(addprefix utils/,$(tools-y))
$(BOOT_TARGETS): $(bootdir-y)
$(bootdir-y): $(addprefix $(obj)/,$(subdir-y))
$(Q)$(MAKE) -f scripts/Makefile.build obj=$(obj)/$@ $(MAKECMDGOALS)
$(bootdir-y): $(addprefix $(obj)/,$(subdir-y)) \
$(addprefix $(obj)/,$(host-progs))
$(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS)
/*
* Copyright (C) Paul Mackerras 1997.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#include "zlib.h"
#include "nonstdio.h"
#include <asm/bootinfo.h>
#include <asm/page.h>
/* Information from the linker */
extern char __sysmap_begin, __sysmap_end;
extern int strcmp(const char *s1, const char *s2);
extern char *avail_ram, *avail_high;
extern char *end_avail;
extern void claim(unsigned int virt, unsigned int size, unsigned int align);
extern void pause(void);
unsigned int heap_use, heap_max;
struct memchunk {
unsigned int size;
struct memchunk *next;
};
static struct memchunk *freechunks;
static void *zalloc(void *x, unsigned items, unsigned size)
{
void *p;
struct memchunk **mpp, *mp;
size *= items;
size = (size + 7) & -8;
heap_use += size;
if (heap_use > heap_max)
heap_max = heap_use;
for (mpp = &freechunks; (mp = *mpp) != 0; mpp = &mp->next) {
if (mp->size == size) {
*mpp = mp->next;
return mp;
}
}
p = avail_ram;
avail_ram += size;
if (avail_ram > avail_high)
avail_high = avail_ram;
if (avail_ram > end_avail) {
printf("oops... out of memory\n\r");
pause();
}
return p;
}
static void zfree(void *x, void *addr, unsigned nb)
{
struct memchunk *mp = addr;
nb = (nb + 7) & -8;
heap_use -= nb;
if (avail_ram == addr + nb) {
avail_ram = addr;
return;
}
mp->size = nb;
mp->next = freechunks;
freechunks = mp;
}
#define HEAD_CRC 2
#define EXTRA_FIELD 4
#define ORIG_NAME 8
#define COMMENT 0x10
#define RESERVED 0xe0
#define DEFLATED 8
void gunzip(void *dst, int dstlen, unsigned char *src, int *lenp)
{
z_stream s;
int r, i, flags;
/* skip header */
i = 10;
flags = src[3];
if (src[2] != DEFLATED || (flags & RESERVED) != 0) {
printf("bad gzipped data\n\r");
exit();
}
if ((flags & EXTRA_FIELD) != 0)
i = 12 + src[10] + (src[11] << 8);
if ((flags & ORIG_NAME) != 0)
while (src[i++] != 0)
;
if ((flags & COMMENT) != 0)
while (src[i++] != 0)
;
if ((flags & HEAD_CRC) != 0)
i += 2;
if (i >= *lenp) {
printf("gunzip: ran out of data in header\n\r");
exit();
}
s.zalloc = zalloc;
s.zfree = zfree;
r = inflateInit2(&s, -MAX_WBITS);
if (r != Z_OK) {
printf("inflateInit2 returned %d\n\r", r);
exit();
}
s.next_in = src + i;
s.avail_in = *lenp - i;
s.next_out = dst;
s.avail_out = dstlen;
r = inflate(&s, Z_FINISH);
if (r != Z_OK && r != Z_STREAM_END) {
printf("inflate returned %d msg: %s\n\r", r, s.msg);
exit();
}
*lenp = s.next_out - (unsigned char *) dst;
inflateEnd(&s);
}
/* Make a bi_rec in OF. We need to be passed a name for BI_BOOTLOADER_ID,
* a machine type for BI_MACHTYPE, and the location where the end of the
* bootloader is (PROG_START + PROG_SIZE)
*/
void make_bi_recs(unsigned long addr, char *name, unsigned int mach,
unsigned long progend)
{
unsigned long sysmap_size;
struct bi_record *rec;
/* FIgure out the size of a possible System.map we're going to
* pass along.
* */
sysmap_size = (unsigned long)(&__sysmap_end) -
(unsigned long)(&__sysmap_begin);
/* leave a 1MB gap then align to the next 1MB boundary */
addr = _ALIGN(addr+ (1<<20) - 1, (1<<20));
/* oldworld machine seem very unhappy about this. -- Tom */
if (addr >= progend)
claim(addr, 0x1000, 0);
rec = (struct bi_record *)addr;
rec->tag = BI_FIRST;
rec->size = sizeof(struct bi_record);
rec = (struct bi_record *)((unsigned long)rec + rec->size);
rec->tag = BI_BOOTLOADER_ID;
sprintf( (char *)rec->data, name);
rec->size = sizeof(struct bi_record) + strlen(name) + 1;
rec = (struct bi_record *)((unsigned long)rec + rec->size);
rec->tag = BI_MACHTYPE;
rec->data[0] = mach;
rec->data[1] = 1;
rec->size = sizeof(struct bi_record) + 2 * sizeof(unsigned long);
rec = (struct bi_record *)((unsigned long)rec + rec->size);
if (sysmap_size) {
rec->tag = BI_SYSMAP;
rec->data[0] = (unsigned long)(&__sysmap_begin);
rec->data[1] = sysmap_size;
rec->size = sizeof(struct bi_record) + 2 *
sizeof(unsigned long);
rec = (struct bi_record *)((unsigned long)rec + rec->size);
}
rec->tag = BI_LAST;
rec->size = sizeof(struct bi_record);
rec = (struct bi_record *)((unsigned long)rec + rec->size);
}
......@@ -143,7 +143,9 @@ $(images)/zImage.initrd.chrp-rs6k: $(images)/zImage.initrd.chrp $(ADDNOTE)
$(ADDNOTE) $@
zImage: $(images)/vmlinux.coff $(images)/vmlinux.elf-pmac \
$(images)/zImage.chrp $(images)/miboot.image
$(images)/zImage.chrp $(images)/zImage.chrp-rs6k \
$(images)/miboot.image
zImage.initrd: $(images)/vmlinux.initrd.coff $(images)/vmlinux.initrd.elf-pmac\
$(images)/zImage.initrd.chrp $(images)/miboot.initrd.image
$(images)/zImage.initrd.chrp $(images)/zImage.initrd.chrp-rs6k\
$(images)/miboot.initrd.image
/* Open Firmware Client Interface */
#include "of1275.h"
static int (*of_server)(void *) = (int(*)(void*))-1;
void
of_init(void *handler)
{
of_server = (int(*)(void*))handler;
}
/* 6.3.2.1 Client interface */
int
of_test(const char *name, int *missing)
{
int result;
static of_test_service s;
s.service = "test";
s.n_args = 1;
s.n_returns = 1;
s.name = name;
result = of_server(&s);
*missing = s.missing;
return result;
}
/* 6.3.2.2 Device tree */
int
of_peer(int phandle, int *sibling_phandle)
{
int result;
static of_peer_service s;
s.service = "peer";
s.n_args = 1;
s.n_returns = 1;
s.phandle = phandle;
result = of_server(&s);
*sibling_phandle = s.sibling_phandle;
return result;
}
int
of_child(int phandle, int *child_phandle)
{
int result;
static of_child_service s;
s.service = "child";
s.n_args = 1;
s.n_returns = 1;
s.phandle = phandle;
result = of_server(&s);
*child_phandle = s.child_phandle;
return result;
}
int
of_parent(int phandle, int *parent_phandle)
{
int result;
static of_parent_service s;
s.service = "parent";
s.n_args = 1;
s.n_returns = 1;
s.phandle = phandle;
result = of_server(&s);
*parent_phandle = s.parent_phandle;
return result;
}
int
of_instance_to_package(int ihandle, int *phandle)
{
int result;
static of_instance_to_package_service s;
s.service = "instance-to-package";
s.n_args = 1;
s.n_returns = 1;
s.ihandle = ihandle;
result = of_server(&s);
*phandle = s.phandle;
return result;
}
int
of_getproplen(int phandle, const char *name, int *proplen)
{
int result;
static of_getproplen_service s;
s.service = "getproplen";
s.n_args = 2;
s.n_returns = 1;
s.phandle = phandle;
s.name = name;
result = of_server(&s);
*proplen = s.proplen;
return result;
}
int
of_getprop(int phandle, const char *name, void *buf, int buflen, int *size)
{
int result;
static of_getprop_service s;
s.service = "getprop";
s.n_args = 4;
s.n_returns = 1;
s.phandle = phandle;
s.name = name;
s.buf = buf;
s.buflen = buflen;
result = of_server(&s);
*size = s.size;
return result;
}
int
of_nextprop(int phandle, const char *previous, void *buf, int *flag)
{
int result;
static of_nextprop_service s;
s.service = "nextprop";
s.n_args = 3;
s.n_returns = 1;
s.phandle = phandle;
s.previous = previous;
s.buf = buf;
result = of_server(&s);
*flag = s.flag;
return result;
}
int
of_setprop(int phandle, const char *name, void *buf, int len, int *size)
{
int result;
static of_setprop_service s;
s.service = "setprop";
s.n_args = 4;
s.n_returns = 1;
s.phandle = phandle;
s.name = name;
s.buf = buf;
s.len = len;
result = of_server(&s);
*size = s.size;
return result;
}
int
of_canon(const char *device_specifier, void *buf, int buflen, int *length)
{
int result;
static of_canon_service s;
s.service = "canon";
s.n_args = 3;
s.n_returns = 1;
s.device_specifier = device_specifier;
s.buf = buf;
s.buflen = buflen;
result = of_server(&s);
*length = s.length;
return result;
}
int
of_finddevice(const char *device_specifier, int *phandle)
{
int result;
static of_finddevice_service s;
s.service = "finddevice";
s.n_args = 1;
s.n_returns = 1;
s.device_specifier = device_specifier;
result = of_server(&s);
*phandle = s.phandle;
return result;
}
int
of_instance_to_path(int ihandle, void *buf, int buflen, int *length)
{
int result;
static of_instance_to_path_service s;
s.service = "instance-to-path";
s.n_args = 3;
s.n_returns = 1;
s.ihandle = ihandle;
s.buf = buf;
s.buflen = buflen;
result = of_server(&s);
*length = s.length;
return result;
}
int
of_package_to_path(int phandle, void *buf, int buflen, int *length)
{
int result;
static of_package_to_path_service s;
s.service = "package-to-path";
s.n_args = 3;
s.n_returns = 1;
s.phandle = phandle;
s.buf = buf;
s.buflen = buflen;
result = of_server(&s);
*length = s.length;
return result;
}
/* int of_call_method(const char *method, int ihandle, ...); */
/* 6.3.2.3 Device I/O */
int
of_open(const char *device_specifier, int *ihandle)
{
int result;
static of_open_service s;
s.service = "open";
s.n_args = 1;
s.n_returns = 1;
s.device_specifier = device_specifier;
result = of_server(&s);
*ihandle = s.ihandle;
return result;
}
int
of_close(int ihandle)
{
int result;
static of_close_service s;
s.service = "close";
s.n_args = 1;
s.n_returns = 0;
s.ihandle = ihandle;
result = of_server(&s);
return result;
}
int
of_read(int ihandle, void *addr, int len, int *actual)
{
int result;
static of_read_service s;
s.service = "read";
s.n_args = 3;
s.n_returns = 1;
s.ihandle = ihandle;
s.addr = addr;
s.len = len;
result = of_server(&s);
*actual = s.actual;
return result;
}
int
of_write(int ihandle, void *addr, int len, int *actual)
{
int result;
static of_write_service s;
s.service = "write";
s.n_args = 3;
s.n_returns = 1;
s.ihandle = ihandle;
s.addr = addr;
s.len = len;
result = of_server(&s);
*actual = s.actual;
return result;
}
int
of_seek(int ihandle, int pos_hi, int pos_lo, int *status)
{
int result;
static of_seek_service s;
s.service = "seek";
s.n_args = 3;
s.n_returns = 1;
s.ihandle = ihandle;
s.pos_hi = pos_hi;
s.pos_lo = pos_lo;
result = of_server(&s);
*status = s.status;
return result;
}
/* 6.3.2.4 Memory */
int
of_claim(void *virt, int size, int align, void **baseaddr)
{
int result;
static of_claim_service s;
s.service = "claim";
s.n_args = 3;
s.n_returns = 1;
s.virt = virt;
s.size = size;
s.align = align;
result = of_server(&s);
*baseaddr = s.baseaddr;
return result;
}
int
of_release(void *virt, int size)
{
int result;
static of_release_service s;
s.service = "release";
s.n_args = 2;
s.n_returns = 0;
s.virt = virt;
s.size = size;
result = of_server(&s);
return result;
}
/* 6.3.2.5 Control transfer */
int
of_boot(const char *bootspec)
{
int result;
static of_boot_service s;
s.service = "boot";
s.n_args = 1;
s.n_returns = 0;
s.bootspec = bootspec;
result = of_server(&s);
return result;
}
int
of_enter(void)
{
int result;
static of_enter_service s;
s.service = "enter";
s.n_args = 0;
s.n_returns = 0;
result = of_server(&s);
return result;
}
int
of_exit(void)
{
int result;
static of_exit_service s;
s.service = "exit";
s.n_args = 0;
s.n_returns = 0;
result = of_server(&s);
return result;
}
/* int of_chain(void *virt, int size, void *entry, void *args, int len); */
/* 6.3.2.6 User interface */
/* int of_interpret(const char *arg, ...); */
int
of_set_callback(void *newfunc, void **oldfunc)
{
int result;
static of_set_callback_service s;
s.service = "set-callback";
s.n_args = 1;
s.n_returns = 1;
s.newfunc = newfunc;
result = of_server(&s);
*oldfunc = s.oldfunc;
return result;
}
int
of_set_symbol_lookup(void *sym_to_value, void *value_to_sym)
{
int result;
static of_set_symbol_lookup_service s;
s.service = "set-symbol-lookup";
s.n_args = 2;
s.n_returns = 0;
s.sym_to_value = sym_to_value;
s.value_to_sym = s.value_to_sym;
result = of_server(&s);
return result;
}
/* 6.3.2.7 Time */
int
of_milliseconds(int *ms)
{
int result;
static of_milliseconds_service s;
s.service = "milliseconds";
s.n_args = 0;
s.n_returns = 1;
result = of_server(&s);
*ms = s.ms;
return result;
}
/* 6.3.2.1 Client interface */
typedef struct _of_test_service {
const char *service;
int n_args;
int n_returns;
/*in*/
const char *name;
/*out*/
int missing;
} of_test_service;
int of_test(const char *name, int *missing);
/* 6.3.2.2 Device tree */
typedef struct _of_peer_service {
const char *service;
int n_args;
int n_returns;
/*in*/
int phandle;
/*out*/
int sibling_phandle;
} of_peer_service;
int of_peer(int phandle, int *sibling_phandle);
typedef struct _of_child_service {
const char *service;
int n_args;
int n_returns;
/*in*/
int phandle;
/*out*/
int child_phandle;
} of_child_service;
int of_child(int phandle, int *child_phandle);
typedef struct _of_parent_service {
const char *service;
int n_args;
int n_returns;
/*in*/
int phandle;
/*out*/
int parent_phandle;
} of_parent_service;
int of_child(int phandle, int *parent_phandle);
typedef struct _of_instance_to_package_service {
const char *service;
int n_args;
int n_returns;
/*in*/
int ihandle;
/*out*/
int phandle;
} of_instance_to_package_service;
int of_instance_to_package(int ihandle, int *phandle);
typedef struct _of_getproplen_service {
const char *service;
int n_args;
int n_returns;
/*in*/
int phandle;
const char *name;
/*out*/
int proplen;
} of_getproplen_service;
int of_getproplen(int phandle, const char *name, int *proplen);
typedef struct _of_getprop_service {
const char *service;
int n_args;
int n_returns;
/*in*/
int phandle;
const char *name;
void *buf;
int buflen;
/*out*/
int size;
} of_getprop_service;
int of_getprop(int phandle, const char *name, void *buf, int buflen,
int *size);
typedef struct _of_nextprop_service {
const char *service;
int n_args;
int n_returns;
/*in*/
int phandle;
const char *previous;
void *buf;
/*out*/
int flag;
} of_nextprop_service;
int of_nextprop(int phandle, const char *previous, void *buf, int *flag);
typedef struct _of_setprop_service {
const char *service;
int n_args;
int n_returns;
/*in*/
int phandle;
const char *name;
void *buf;
int len;
/*out*/
int size;
} of_setprop_service;
int of_setprop(int phandle, const char *name, void *buf, int len, int *size);
typedef struct _of_canon_service {
const char *service;
int n_args;
int n_returns;
/*in*/
const char *device_specifier;
void *buf;
int buflen;
/*out*/
int length;
} of_canon_service;
int of_canon(const char *device_specifier, void *buf, int buflen, int *length);
typedef struct _of_finddevice_service {
const char *service;
int n_args;
int n_returns;
/*in*/
const char *device_specifier;
/*out*/
int phandle;
} of_finddevice_service;
int of_finddevice(const char *device_specifier, int *phandle);
typedef struct _of_instance_to_path_service {
const char *service;
int n_args;
int n_returns;
/*in*/
int ihandle;
void *buf;
int buflen;
/*out*/
int length;
} of_instance_to_path_service;
int of_instance_to_path(int ihandle, void *buf, int buflen, int *length);
typedef struct _of_package_to_path_service {
const char *service;
int n_args;
int n_returns;
/*in*/
int phandle;
void *buf;
int buflen;
/*out*/
int length;
} of_package_to_path_service;
int of_package_to_path(int phandle, void *buf, int buflen, int *length);
typedef struct _of_call_method_service {
const char *service;
int n_args;
int n_returns;
/*in*/
const char *method;
int ihandle;
/*...*/
int args[0];
} of_call_method_service;
int of_call_method(const char *method, int ihandle, ...);
/* 6.3.2.3 Device I/O */
typedef struct _of_open_service {
const char *service;
int n_args;
int n_returns;
/*in*/
const char *device_specifier;
/*out*/
int ihandle;
} of_open_service;
int of_open(const char *device_specifier,
int *ihandle);
typedef struct _of_close_service {
const char *service;
int n_args;
int n_returns;
/*in*/
int ihandle;
/*out*/
} of_close_service;
int of_close(int ihandle);
typedef struct _of_read_service {
const char *service;
int n_args;
int n_returns;
/*in*/
int ihandle;
void *addr;
int len;
/*out*/
int actual;
} of_read_service;
int of_read(int ihandle, void *addr, int len, int *actual);
typedef struct _of_write_service {
const char *service;
int n_args;
int n_returns;
/*in*/
int ihandle;
void *addr;
int len;
/*out*/
int actual;
} of_write_service;
int of_write(int ihandle, void *addr, int len, int *actual);
typedef struct _of_seek_service {
const char *service;
int n_args;
int n_returns;
/*in*/
int ihandle;
int pos_hi;
int pos_lo;
/*out*/
int status;
} of_seek_service;
int of_seek(int ihandle, int pos_hi, int pos_lo, int *status);
/* 6.3.2.4 Memory */
typedef struct _of_claim_service {
const char *service;
int n_args;
int n_returns;
/*in*/
void *virt;
int size;
int align;
/*out*/
void *baseaddr;
} of_claim_service;
int of_claim(void *virt, int size, int align, void **baseaddr);
typedef struct _of_release_service {
const char *service;
int n_args;
int n_returns;
/*in*/
void *virt;
int size;
int align;
/*out*/
} of_release_service;
int of_release(void *virt, int size);
/* 6.3.2.5 Control transfer */
typedef struct _of_boot_service {
const char *service;
int n_args;
int n_returns;
/*in*/
const char *bootspec;
/*out*/
} of_boot_service;
int of_boot(const char *bootspec);
typedef struct _of_enter_service {
const char *service;
int n_args;
int n_returns;
/*in*/
/*out*/
} of_enter_service;
int of_enter(void);
typedef struct _of_exit_service {
const char *service;
int n_args;
int n_returns;
/*in*/
/*out*/
} of_exit_service;
int of_exit(void);
typedef struct _of_chain_service {
const char *service;
int n_args;
int n_returns;
/*in*/
void *virt;
int size;
void *entry;
void *args;
int len;
/*out*/
} of_chain_service;
int of_chain(void *virt, int size, void *entry, void *args, int len);
/* 6.3.2.6 User interface */
typedef struct _of_interpret_service {
const char *service;
int n_args;
int n_returns;
/*in*/
const char *cmd;
int args[0];
/*...*/
/*out*/
/*...*/
} of_interpret_service;
int of_interpret(const char *arg, ...);
typedef struct _of_set_callback_service {
const char *service;
int n_args;
int n_returns;
/*in*/
void *newfunc;
/*out*/
void *oldfunc;
} of_set_callback_service;
int of_set_callback(void *newfunc, void **oldfunc);
typedef struct _of_set_symbol_lookup_service {
const char *service;
int n_args;
int n_returns;
/*in*/
void *sym_to_value;
void *value_to_sym;
/*out*/
} of_set_symbol_lookup_service;
int of_set_symbol_lookup(void *sym_to_value, void *value_to_sym);
/* 6.3.2.7 Time */
typedef struct _of_milliseconds_service {
const char *service;
int n_args;
int n_returns;
/*in*/
/*out*/
int ms;
} of_milliseconds_service;
int of_milliseconds(int *ms);
......@@ -217,17 +217,17 @@ $(images)/zImage.initrd-STRIPELF: $(obj)/zvmlinux.initrd
dd if=$(obj)/zvmlinux.initrd of=$(images)/zImage.initrd.$(END) \
skip=64 bs=1k
$(images)/zImage-TREE: $(obj)/zvmlinux
$(images)/zImage-TREE: $(obj)/zvmlinux $(MKTREE)
$(MKTREE) $(obj)/zvmlinux $(images)/zImage.$(END) $(ENTRYPOINT)
$(images)/zImage.initrd-TREE: $(obj)/zvmlinux.initrd
$(images)/zImage.initrd-TREE: $(obj)/zvmlinux.initrd $(MKTREE)
$(MKTREE) $(obj)/zvmlinux.initrd $(images)/zImage.initrd.$(END) \
$(ENTRYPOINT)
$(images)/zImage-MENF1: $(obj)/zvmlinux
$(images)/zImage-MENF1: $(obj)/zvmlinux $(MKPREP)
$(MKPREP) -pbp $(obj)/zvmlinux $(images)/zImage.menf1
$(images)/zImage.initrd-MENF1: $(obj)/zvmlinux.initrd
$(images)/zImage.initrd-MENF1: $(obj)/zvmlinux.initrd $(MKPREP)
$(MKPREP) -pbp $(obj)/zvmlinux.initrd $(images)/zImage.initrd.menf1
$(images)/zImage-PPLUS: $(obj)/zvmlinux $(MKPREP) $(MKBUGBOOT)
......
......@@ -655,6 +655,7 @@ embed_config(bd_t **bdp)
}
#endif /* WILLOW */
#ifdef CONFIG_XILINX_ML300
void
embed_config(bd_t ** bdp)
{
......@@ -688,6 +689,7 @@ embed_config(bd_t ** bdp)
bd->bi_intfreq = XPAR_CORE_CLOCK_FREQ_HZ;
bd->bi_busfreq = XPAR_PLB_CLOCK_FREQ_HZ;
}
#endif /* CONFIG_XILINX_ML300 */
#ifdef CONFIG_IBM_OPENBIOS
/* This could possibly work for all treeboot roms.
......@@ -801,7 +803,7 @@ embed_config(bd_t **bdp)
* just to be sure. */
mtdcr(DCRN_MALCR(DCRN_MAL_BASE), MALCR_MMSR); /* 1st reset MAL */
while (mfdcr(DCRN_MALCR(DCRN_MAL_BASE)) & MALCR_MMSR) {}; /* wait for the reset */
out_be32(EMAC0_BASE,0x20000000); /* then reset EMAC */
out_be32((unsigned *)EMAC0_BASE,0x20000000); /* then reset EMAC */
bd = &bdinfo;
*bdp = bd;
......
......@@ -9,6 +9,7 @@
#include <linux/config.h>
#include <linux/types.h>
#include <linux/elf.h>
#include <linux/string.h>
#include <asm/bootinfo.h>
#include <asm/ibm4xx.h>
#include <asm/mmu.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment