Author: blueswirl Date: 2009-01-17 11:15:13 +0100 (Sat, 17 Jan 2009) New Revision: 413
Modified: openbios-devel/drivers/escc.c openbios-devel/drivers/obio.c openbios-devel/drivers/sbus.c Log: Use aliases for console device selection
Modified: openbios-devel/drivers/escc.c =================================================================== --- openbios-devel/drivers/escc.c 2009-01-17 09:55:09 UTC (rev 412) +++ openbios-devel/drivers/escc.c 2009-01-17 10:15:13 UTC (rev 413) @@ -318,6 +318,7 @@ ob_zs_init(uint64_t base, uint64_t offset, int intr, int slave, int keyboard) { char nodebuff[256]; + phandle_t aliases;
ob_new_obio_device("zs", "serial");
@@ -348,8 +349,21 @@ (int)offset & 0xffffffff); if (keyboard) { REGISTER_NODE_METHODS(escc_keyboard, nodebuff); + + aliases = find_dev("/aliases"); + set_property(aliases, "keyboard", nodebuff, strlen(nodebuff) + 1); } else { REGISTER_NODE_METHODS(escc, nodebuff); + + aliases = find_dev("/aliases"); + snprintf(nodebuff, sizeof(nodebuff), "/obio/zs@0,%x:a", + (int)offset & 0xffffffff); + set_property(aliases, "ttya", nodebuff, strlen(nodebuff) + 1); + + snprintf(nodebuff, sizeof(nodebuff), "/obio/zs@0,%x:b", + (int)offset & 0xffffffff); + set_property(aliases, "ttyb", nodebuff, strlen(nodebuff) + 1); + } }
Modified: openbios-devel/drivers/obio.c =================================================================== --- openbios-devel/drivers/obio.c 2009-01-17 09:55:09 UTC (rev 412) +++ openbios-devel/drivers/obio.c 2009-01-17 10:15:13 UTC (rev 413) @@ -907,24 +907,26 @@ if (nographic) { obp_stdin = PROMDEV_TTYA; obp_stdout = PROMDEV_TTYA; - stdin = "/obio/zs@0,100000:a"; - stdout = "/obio/zs@0,100000:a"; + stdin = "ttya"; + stdout = "ttya"; } else { obp_stdin = PROMDEV_KBD; obp_stdout = PROMDEV_SCREEN; - stdin = "/obio/zs@0,0:a"; - stdout = "/iommu/sbus/SUNW,tcx"; + stdin = "keyboard"; + stdout = "screen"; }
push_str("/"); fword("find-device");
push_str(stdin); + fword("pathres-resolve-aliases"); fword("encode-string"); push_str("stdin-path"); fword("property");
push_str(stdout); + fword("pathres-resolve-aliases"); fword("encode-string"); push_str("stdout-path"); fword("property");
Modified: openbios-devel/drivers/sbus.c =================================================================== --- openbios-devel/drivers/sbus.c 2009-01-17 09:55:09 UTC (rev 412) +++ openbios-devel/drivers/sbus.c 2009-01-17 10:15:13 UTC (rev 413) @@ -89,9 +89,11 @@ uint16_t graphic_depth;
static void -ob_tcx_init(unsigned int slot) +ob_tcx_init(unsigned int slot, const char *path) { - push_str("/iommu/sbus/SUNW,tcx"); + phandle_t chosen, aliases; + + push_str(path); fword("find-device");
PUSH(slot); @@ -277,6 +279,14 @@ push_str("tcx-8-bit"); fword("property"); } + + chosen = find_dev("/chosen"); + push_str(path); + fword("open-dev"); + set_int_property(chosen, "screen", POP()); + + aliases = find_dev("/aliases"); + set_property(aliases, "screen", path, strlen(path) + 1); }
static void @@ -373,7 +383,7 @@ // OpenBIOS and Qemu don't know how to do Sbus probing switch(slot) { case 3: // SUNW,tcx - ob_tcx_init(slot); + ob_tcx_init(slot, "/iommu/sbus/SUNW,tcx"); break; case 4: // SUNW,CS4231 @@ -395,7 +405,7 @@ // OpenBIOS and Qemu don't know how to do Sbus probing switch(slot) { case 2: // SUNW,tcx - ob_tcx_init(slot); + ob_tcx_init(slot, "/iommu/sbus/SUNW,tcx"); break; case 0xf: // le, esp, bpp, power-management ob_macio_init(slot, base, 0); @@ -413,7 +423,7 @@ // OpenBIOS and Qemu don't know how to do Sbus probing switch(slot) { case 2: // SUNW,tcx - ob_tcx_init(slot); + ob_tcx_init(slot, "/iommu/sbus/SUNW,tcx"); break; case 0xf: // le, esp, bpp, power-management #ifdef CONFIG_DRIVER_ESP