Hi,
I wanted to do the below (based on the nvram code in the same file), but it doesn't work (I always get zero). Can anyone explain what I'm doing wrong?
(This isn't a suggested fix/patch, I'm just wondering what I'm missing.)
- Alyssa
@@ -162,6 +162,7 @@ macio_nvram_get(char *buf) static void openpic_init(const char *path, phys_addr_t addr) { + phandle_t chosen; phandle_t dnode; int props[2]; char buf[128]; @@ -186,6 +187,11 @@ openpic_init(const char *path, phys_addr_t addr) set_int_property(dnode, "clock-frequency", 4166666);
fword("finish-device"); + + chosen = find_dev("/chosen"); + push_str(buf); + fword("open-dev"); + set_int_property(chosen, "interrupt-controller", POP()); }
DECLARE_NODE(ob_macio, INSTALL_OPEN, sizeof(int), "Tmac-io");