Index: boot/genarch/ofw.c
===================================================================
--- boot/genarch/ofw.c	(revision f817d3a500d65d74090358c680483a7a8c72924e)
+++ boot/genarch/ofw.c	(revision 753d8515dfafce94cdf184d68aa5c942525400db)
@@ -26,5 +26,5 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
- 
+
 #include <ofw.h>
 #include <ofwarch.h>
@@ -373,13 +373,20 @@
 }
 
+#define RED(i)    (((i) >> 5) & ((1 << 3) - 1))
+#define GREEN(i)  (((i) >> 3) & ((1 << 2) - 1))
+#define BLUE(i)   ((i) & ((1 << 3) - 1))
+#define CLIP(i)   ((i) <= 255 ? (i) : 255)
+
+
 /**
  * Sets up the palette for the 8-bit color depth configuration so that the
  * 3:2:3 color scheme can be used. Checks that setting the palette makes sense
  * (appropriate nodes exist in the OBP tree and the color depth is not greater
- * than 8). 
- *
- * @return	true if the palette has been set, false otherwise
+ * than 8).
+ *
+ * @return true if the palette has been set, false otherwise
+ *
  */
-int setup_palette(void)
+int ofw_setup_palette(void)
 {
 	char device_name[BUF_SIZE];
@@ -387,7 +394,7 @@
 	/* resolve alias */
 	if (ofw_get_property(ofw_aliases, "screen", device_name,
-		sizeof(device_name)) <= 0)
-		return false;
-
+	    sizeof(device_name)) <= 0)
+		return false;
+	
 	/* for depth greater than 8 it makes no sense to set up the palette */
 	uint32_t depth;
@@ -404,13 +411,10 @@
 	if (screen == -1)
 		return false;
-
+	
 	/* setup the palette so that the (inverted) 3:2:3 scheme is usable */
 	unsigned int i;
 	for (i = 0; i < 256; i++)
-		if (ofw_call("call-method", 6, 1, NULL, "color!", screen,
-			255 - i,
-			i << 5,
-			(i >> 3) << 6,
-			(i >> 5) << 5) != 0); 
+		ofw_call("call-method", 6, 1, NULL, "color!", screen,
+		    255 - i, CLIP(BLUE(i) * 37), GREEN(i) * 85, CLIP(RED(i) * 37));
 	return true;
 }
Index: boot/genarch/ofw.h
===================================================================
--- boot/genarch/ofw.h	(revision f817d3a500d65d74090358c680483a7a8c72924e)
+++ boot/genarch/ofw.h	(revision 753d8515dfafce94cdf184d68aa5c942525400db)
@@ -124,5 +124,5 @@
 extern int ofw_screen(screen_t *screen);
 extern int ofw_macio(macio_t *macio);
-extern int setup_palette(void);
+extern int ofw_setup_palette(void);
 extern void ofw_quiesce(void);
 
