Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67187
b: refs/heads/master
c: 0d279d4
h: refs/heads/master
i:
  67185: 3722be9
  67183: df26a4f
v: v3
  • Loading branch information
David Gibson authored and Paul Mackerras committed Aug 17, 2007
1 parent fcc4289 commit 2ef9222
Show file tree
Hide file tree
Showing 5 changed files with 163 additions and 127 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9420dc65ff9e6b67c032286efde823aeb8684670
refs/heads/master: 0d279d47612d1b63155a1d9637a6fc5143dad594
1 change: 1 addition & 0 deletions trunk/arch/powerpc/boot/dts/ebony.dts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@
fpga@7,0 {
compatible = "Ebony-FPGA";
reg = <7 0 10>;
virtual-reg = <e8300000>;
};
};

Expand Down
39 changes: 39 additions & 0 deletions trunk/arch/powerpc/boot/ebony.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "page.h"
#include "ops.h"
#include "reg.h"
#include "io.h"
#include "dcr.h"
#include "44x.h"

Expand Down Expand Up @@ -92,6 +93,43 @@ void ibm440gp_fixup_clocks(unsigned int sysclk, unsigned int ser_clk)
dt_fixup_clock("/plb/opb/serial@40000300", uart1);
}

#define EBONY_FPGA_PATH "/plb/opb/ebc/fpga"
#define EBONY_FPGA_FLASH_SEL 0x01
#define EBONY_SMALL_FLASH_PATH "/plb/opb/ebc/small-flash"

static void ebony_flashsel_fixup(void)
{
void *devp;
u32 reg[3] = {0x0, 0x0, 0x80000};
u8 *fpga;
u8 fpga_reg0 = 0x0;

devp = finddevice(EBONY_FPGA_PATH);
if (!devp)
fatal("Couldn't locate FPGA node %s\n\r", EBONY_FPGA_PATH);

if (getprop(devp, "virtual-reg", &fpga, sizeof(fpga)) != sizeof(fpga))
fatal("%s has missing or invalid virtual-reg property\n\r",
EBONY_FPGA_PATH);

fpga_reg0 = in_8(fpga);

devp = finddevice(EBONY_SMALL_FLASH_PATH);
if (!devp)
fatal("Couldn't locate small flash node %s\n\r",
EBONY_SMALL_FLASH_PATH);

if (getprop(devp, "reg", reg, sizeof(reg)) != sizeof(reg))
fatal("%s has reg property of unexpected size\n\r",
EBONY_SMALL_FLASH_PATH);

/* Invert address bit 14 (IBM-endian) if FLASH_SEL fpga bit is set */
if (fpga_reg0 & EBONY_FPGA_FLASH_SEL)
reg[1] ^= 0x80000;

setprop(devp, "reg", reg, sizeof(reg));
}

static void ebony_fixups(void)
{
// FIXME: sysclk should be derived by reading the FPGA registers
Expand All @@ -101,6 +139,7 @@ static void ebony_fixups(void)
ibm44x_fixup_memsize();
dt_fixup_mac_addresses(ebony_mac0, ebony_mac1);
ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
ebony_flashsel_fixup();
}

void ebony_init(void *mac0, void *mac1)
Expand Down
Loading

0 comments on commit 2ef9222

Please sign in to comment.