diff --git a/arch/sparc32/openbios.c b/arch/sparc32/openbios.c index f132057..e421f77 100644 --- a/arch/sparc32/openbios.c +++ b/arch/sparc32/openbios.c @@ -95,18 +95,17 @@ arch_init( void ) void setup_timers(void); modules_init(); -#ifdef CONFIG_DRIVER_SBUS ob_init_mmu(hwdef->iommu_high, hwdef->iommu_base); - ob_sbus_init(hwdef->iommu_high, hwdef->iommu_base + 0x1000, hwdef->machine_id); - -#ifdef CONFIG_DEBUG_CONSOLE_VIDEO - init_video(); -#endif -#endif #ifdef CONFIG_DRIVER_OBIO ob_obio_init(hwdef->slavio_high, hwdef->slavio_base, hwdef->fd_offset, hwdef->counter_offset, hwdef->intr_offset); nvram_init(); +#endif +#ifdef CONFIG_DRIVER_SBUS +#ifdef CONFIG_DEBUG_CONSOLE_VIDEO + init_video(); +#endif + ob_sbus_init(hwdef->iommu_high, hwdef->iommu_base + 0x1000, hwdef->machine_id); #endif device_end(); diff --git a/arch/sparc32/tree.fs b/arch/sparc32/tree.fs index 2ef2625..4036cfd 100644 --- a/arch/sparc32/tree.fs +++ b/arch/sparc32/tree.fs @@ -88,8 +88,6 @@ new-device h# 300 encode-int " height" property h# 400 encode-int " width" property h# 400 encode-int " linebytes" property - d# 24 encode-int " depth" property - " no" encode-string " tcx-8-bit" property 5 encode-int 0 encode-int encode+ " intr" property 5 encode-int " interrupts" property finish-device diff --git a/drivers/obio.c b/drivers/obio.c index 72580a8..97e4339 100644 --- a/drivers/obio.c +++ b/drivers/obio.c @@ -349,6 +349,7 @@ ob_nvram_init(unsigned long base, unsigned long offset) extern char boot_device; extern char obp_stdin, obp_stdout; extern const char *obp_stdin_path, *obp_stdout_path; + extern uint16_t graphic_depth; const char *stdin, *stdout, *cpuname; unsigned int i; @@ -386,6 +387,7 @@ ob_nvram_init(unsigned long base, unsigned long offset) boot_device = nv_info.boot_device; nographic = nv_info.nographic; + graphic_depth = nv_info.depth; push_str("mk48t08"); fword("model"); diff --git a/drivers/sbus.c b/drivers/sbus.c index caef992..904b53c 100644 --- a/drivers/sbus.c +++ b/drivers/sbus.c @@ -77,6 +77,8 @@ ob_le_init(unsigned int slot, unsigned long base, unsigned long offset) fword("property"); } +uint16_t graphic_depth; + static void ob_tcx_init(unsigned int slot, unsigned long base) { @@ -98,7 +100,11 @@ ob_tcx_init(unsigned int slot, unsigned long base) PUSH(0x02000000); fword("encode-int"); fword("encode+"); - PUSH(0x00000001); + if (graphic_depth == 24) { + PUSH(0x00400000); + } else { + PUSH(0x00000001); + } fword("encode-int"); fword("encode+"); @@ -108,7 +114,11 @@ ob_tcx_init(unsigned int slot, unsigned long base) PUSH(0x04000000); fword("encode-int"); fword("encode+"); - PUSH(0x00000001); + if (graphic_depth == 24) { + PUSH(0x00400000); + } else { + PUSH(0x00000001); + } fword("encode-int"); fword("encode+"); @@ -128,7 +138,11 @@ ob_tcx_init(unsigned int slot, unsigned long base) PUSH(0x0a000000); fword("encode-int"); fword("encode+"); - PUSH(0x00000001); + if (graphic_depth == 24) { + PUSH(0x00400000); + } else { + PUSH(0x00000001); + } fword("encode-int"); fword("encode+"); @@ -138,7 +152,11 @@ ob_tcx_init(unsigned int slot, unsigned long base) PUSH(0x0c000000); fword("encode-int"); fword("encode+"); - PUSH(0x00000001); + if (graphic_depth == 24) { + PUSH(0x00800000); + } else { + PUSH(0x00000001); + } fword("encode-int"); fword("encode+"); @@ -148,7 +166,11 @@ ob_tcx_init(unsigned int slot, unsigned long base) PUSH(0x0e000000); fword("encode-int"); fword("encode+"); - PUSH(0x00000001); + if (graphic_depth == 24) { + PUSH(0x00800000); + } else { + PUSH(0x00000001); + } fword("encode-int"); fword("encode+"); @@ -168,17 +190,29 @@ ob_tcx_init(unsigned int slot, unsigned long base) PUSH(0x00200000); fword("encode-int"); fword("encode+"); - PUSH(0x00000004); + if (graphic_depth == 24) { + PUSH(0x00004000); + } else { + PUSH(0x00000004); + } fword("encode-int"); fword("encode+"); PUSH(slot); fword("encode-int"); fword("encode+"); - PUSH(0x00300000); + if (graphic_depth == 24) { + PUSH(0x00301000); + } else { + PUSH(0x00300000); + } fword("encode-int"); fword("encode+"); - PUSH(0x0000081c); + if (graphic_depth == 24) { + PUSH(0x00001000); + } else { + PUSH(0x0000081c); + } fword("encode-int"); fword("encode+"); @@ -198,7 +232,11 @@ ob_tcx_init(unsigned int slot, unsigned long base) PUSH(0x00240000); fword("encode-int"); fword("encode+"); - PUSH(0x00000004); + if (graphic_depth == 24) { + PUSH(0x00004000); + } else { + PUSH(0x00000004); + } fword("encode-int"); fword("encode+"); @@ -208,12 +246,28 @@ ob_tcx_init(unsigned int slot, unsigned long base) PUSH(0x00280000); fword("encode-int"); fword("encode+"); - PUSH(0x00000001); + if (graphic_depth == 24) { + PUSH(0x00008000); + } else { + PUSH(0x00000001); + } fword("encode-int"); fword("encode+"); push_str("reg"); fword("property"); + + PUSH((int)graphic_depth); + fword("encode-int"); + push_str("depth"); + fword("property"); + + if (graphic_depth == 8) { + push_str("true"); + fword("encode-string"); + push_str("tcx-8-bit"); + fword("property"); + } } static void