Mac-io cleanup (Laurent Vivier)

git-svn-id: svn://coreboot.org/openbios/openbios-devel@356 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Blue Swirl
2009-01-05 20:30:39 +00:00
parent 6eea2f277a
commit 49d3954458
10 changed files with 176 additions and 124 deletions

View File

@@ -27,7 +27,10 @@
#include "timer.h"
#include "pci.h"
#include "pci_database.h"
#ifdef CONFIG_DRIVER_MACIO
#include "cuda.h"
#include "macio.h"
#endif
#define set_bool_property(ph, name) set_property(ph, name, NULL, 0);
@@ -93,28 +96,10 @@ int eth_config_cb (const pci_config_t *config)
return 0;
}
phandle_t pic_handle;
int macio_config_cb (const pci_config_t *config)
{
#ifdef CONFIG_PPC
char buf[64];
phandle_t ph;
cell props[2];
snprintf(buf, sizeof(buf), "%s/interrupt-controller", config->path);
REGISTER_NAMED_NODE(ob_pci_node, buf);
ph = find_dev(buf);
set_property(ph, "device_type", "interrupt-controller", 21);
set_property(ph, "compatible", "heathrow\0mac-risc", 18);
set_int_property(ph, "#interrupt-cells", 1);
props[0]= 0x10;
props[1]= 0x20;
set_property(ph, "reg", (char *)&props, sizeof(props));
pic_handle = ph;
cuda_init(config->path, config->regions[0]);
macio_nvram_init(config->path, config->regions[0]);
#ifdef CONFIG_DRIVER_MACIO
ob_macio_init(config->path, config->regions[0] & ~0x0000000F);
#endif
return 0;
}