diff options
author | Ronald G. Minnich <rminnich@google.com> | 2013-03-05 13:32:24 -0800 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2013-03-20 05:31:04 +0100 |
commit | ec2d914e198928f89928838476ddbd6e5ef61b98 (patch) | |
tree | db35d146e66043efdc7702bff8939a394debd724 /src/mainboard/google | |
parent | d466d750d71f979ccd6636306b51f2d87cb19cba (diff) |
link/graphics: implement a palette setting operator
Add a new operator, P, for the state machine, meaning
implement a palette fill.
Implement a function (palette) that fills the palette when the
P operator is hit.
This replaces 256 lines in the state machine table with 1.
Change-Id: I67d9219fe7de0ecf1fb9faf92130c00c9f5f8e88
Signed-off-by: Ronald G. Minnich <rminnich@google.com>
Reviewed-on: http://review.coreboot.org/2835
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/mainboard/google')
-rw-r--r-- | src/mainboard/google/link/i915.c | 26 | ||||
-rw-r--r-- | src/mainboard/google/link/i915io.c | 257 | ||||
-rw-r--r-- | src/mainboard/google/link/i915io.h | 1 |
3 files changed, 24 insertions, 260 deletions
diff --git a/src/mainboard/google/link/i915.c b/src/mainboard/google/link/i915.c index d6438cb9d7..1c82e178d4 100644 --- a/src/mainboard/google/link/i915.c +++ b/src/mainboard/google/link/i915.c @@ -95,7 +95,7 @@ setgtt(int start, int end, unsigned long base, int inc) { int i; - for(i = start; i < end; i++){ + for (i = start; i < end; i++){ u32 word = base + i*inc; WRITE32(word|1,(i*4)|1); } @@ -128,6 +128,21 @@ extern struct iodef iodefs[]; static int i915_init_done = 0; +/* fill the palette. This runs when the P opcode is hit. */ +static void palette(void) +{ + int i; + unsigned long color = 0; + + for (i = 0; i < 256; i++, color += 0x010101){ + if (verbose & vio)printk(BIOS_SPEW, + "_LGC_PALETTE_A+%08x: outl %08lx\n", + i<<2, color); + + io_i915_WRITE32(color, _LGC_PALETTE_A + (i<<2)); + } +} + int vbe_mode_info_valid(void); int vbe_mode_info_valid(void) { @@ -178,12 +193,15 @@ int i915lightup(unsigned int pphysbase, globalstart = rdtscll(); /* state machine! */ - for(i = 0, id = iodefs; id->op; i++, id++){ + for (i = 0, id = iodefs; id->op; i++, id++){ switch(id->op){ case M: if (verbose & vmsg) printk(BIOS_SPEW, "%ld: %s\n", globalmicroseconds(), id->msg); break; + case P: + palette(); + break; case R: u = READ32(id->addr); if (verbose & vio)printk(BIOS_SPEW, "%s: Got %08lx, expect %08lx\n", @@ -193,7 +211,7 @@ int i915lightup(unsigned int pphysbase, /* they're going to be polling. * just do it 1000 times */ - for(t = 0; t < 1000 && id->data != u; t++){ + for (t = 0; t < 1000 && id->data != u; t++){ u = READ32(id->addr); } if (verbose & vspin) printk(BIOS_SPEW, @@ -236,7 +254,7 @@ int i915lightup(unsigned int pphysbase, /* optional, we don't even want to take timestamp overhead * if we can avoid it. */ if (0) - for(i = 0, id = iodefs; id->op; i++, id++){ + for (i = 0, id = iodefs; id->op; i++, id++){ switch(id->op){ case R: printk(BIOS_SPEW, "%ld: R %08lx\n", times[i], id->addr); diff --git a/src/mainboard/google/link/i915io.c b/src/mainboard/google/link/i915io.c index 5fd3d4cbbf..eaa2e94508 100644 --- a/src/mainboard/google/link/i915io.c +++ b/src/mainboard/google/link/i915io.c @@ -347,262 +347,7 @@ struct iodef iodefs[] = { {R, 1, "", _PIPEACONF, 0x00000050, }, {W, 1, "", _FDI_RXA_CTL, 0x00020040, }, {R, 1, "", _FDI_RXA_CTL, 0x00020040, 100}, -{W, 1, "", _LGC_PALETTE_A, 0x00000000, }, -{W, 1, "", _LGC_PALETTE_A+0x4, 0x00010101, }, -{W, 1, "", _LGC_PALETTE_A+0x8, 0x00020202, }, -{W, 1, "", _LGC_PALETTE_A+0xc, 0x00030303, }, -{W, 1, "", _LGC_PALETTE_A+0x10, 0x00040404, }, -{W, 1, "", _LGC_PALETTE_A+0x14, 0x00050505, }, -{W, 1, "", _LGC_PALETTE_A+0x18, 0x00060606, }, -{W, 1, "", _LGC_PALETTE_A+0x1c, 0x00070707, }, -{W, 1, "", _LGC_PALETTE_A+0x20, 0x00080808, }, -{W, 1, "", _LGC_PALETTE_A+0x24, 0x00090909, }, -{W, 1, "", _LGC_PALETTE_A+0x28, 0x000a0a0a, }, -{W, 1, "", _LGC_PALETTE_A+0x2c, 0x000b0b0b, }, -{W, 1, "", _LGC_PALETTE_A+0x30, 0x000c0c0c, }, -{W, 1, "", _LGC_PALETTE_A+0x34, 0x000d0d0d, }, -{W, 1, "", _LGC_PALETTE_A+0x38, 0x000e0e0e, }, -{W, 1, "", _LGC_PALETTE_A+0x3c, 0x000f0f0f, }, -{W, 1, "", _LGC_PALETTE_A+0x40, 0x00101010, }, -{W, 1, "", _LGC_PALETTE_A+0x44, 0x00111111, }, -{W, 1, "", _LGC_PALETTE_A+0x48, 0x00121212, }, -{W, 1, "", _LGC_PALETTE_A+0x4c, 0x00131313, }, -{W, 1, "", _LGC_PALETTE_A+0x50, 0x00141414, }, -{W, 1, "", _LGC_PALETTE_A+0x54, 0x00151515, }, -{W, 1, "", _LGC_PALETTE_A+0x58, 0x00161616, }, -{W, 1, "", _LGC_PALETTE_A+0x5c, 0x00171717, }, -{W, 1, "", _LGC_PALETTE_A+0x60, 0x00181818, }, -{W, 1, "", _LGC_PALETTE_A+0x64, 0x00191919, }, -{W, 1, "", _LGC_PALETTE_A+0x68, 0x001a1a1a, }, -{W, 1, "", _LGC_PALETTE_A+0x6c, 0x001b1b1b, }, -{W, 1, "", _LGC_PALETTE_A+0x70, 0x001c1c1c, }, -{W, 1, "", _LGC_PALETTE_A+0x74, 0x001d1d1d, }, -{W, 1, "", _LGC_PALETTE_A+0x78, 0x001e1e1e, }, -{W, 1, "", _LGC_PALETTE_A+0x7c, 0x001f1f1f, }, -{W, 1, "", 0x4a080, 0x00202020, }, -{W, 1, "", 0x4a084, 0x00212121, }, -{W, 1, "", 0x4a088, 0x00222222, }, -{W, 1, "", 0x4a08c, 0x00232323, }, -{W, 1, "", 0x4a090, 0x00242424, }, -{W, 1, "", 0x4a094, 0x00252525, }, -{W, 1, "", 0x4a098, 0x00262626, }, -{W, 1, "", 0x4a09c, 0x00272727, }, -{W, 1, "", 0x4a0a0, 0x00282828, }, -{W, 1, "", 0x4a0a4, 0x00292929, }, -{W, 1, "", 0x4a0a8, 0x002a2a2a, }, -{W, 1, "", 0x4a0ac, 0x002b2b2b, }, -{W, 1, "", 0x4a0b0, 0x002c2c2c, }, -{W, 1, "", 0x4a0b4, 0x002d2d2d, }, -{W, 1, "", 0x4a0b8, 0x002e2e2e, }, -{W, 1, "", 0x4a0bc, 0x002f2f2f, }, -{W, 1, "", 0x4a0c0, 0x00303030, }, -{W, 1, "", 0x4a0c4, 0x00313131, }, -{W, 1, "", 0x4a0c8, 0x00323232, }, -{W, 1, "", 0x4a0cc, 0x00333333, }, -{W, 1, "", 0x4a0d0, 0x00343434, }, -{W, 1, "", 0x4a0d4, 0x00353535, }, -{W, 1, "", 0x4a0d8, 0x00363636, }, -{W, 1, "", 0x4a0dc, 0x00373737, }, -{W, 1, "", 0x4a0e0, 0x00383838, }, -{W, 1, "", 0x4a0e4, 0x00393939, }, -{W, 1, "", 0x4a0e8, 0x003a3a3a, }, -{W, 1, "", 0x4a0ec, 0x003b3b3b, }, -{W, 1, "", 0x4a0f0, 0x003c3c3c, }, -{W, 1, "", 0x4a0f4, 0x003d3d3d, }, -{W, 1, "", 0x4a0f8, 0x003e3e3e, }, -{W, 1, "", 0x4a0fc, 0x003f3f3f, }, -{W, 1, "", 0x4a100, 0x00404040, }, -{W, 1, "", 0x4a104, 0x00414141, }, -{W, 1, "", 0x4a108, 0x00424242, }, -{W, 1, "", 0x4a10c, 0x00434343, }, -{W, 1, "", 0x4a110, 0x00444444, }, -{W, 1, "", 0x4a114, 0x00454545, }, -{W, 1, "", 0x4a118, 0x00464646, }, -{W, 1, "", 0x4a11c, 0x00474747, }, -{W, 1, "", 0x4a120, 0x00484848, }, -{W, 1, "", 0x4a124, 0x00494949, }, -{W, 1, "", 0x4a128, 0x004a4a4a, }, -{W, 1, "", 0x4a12c, 0x004b4b4b, }, -{W, 1, "", 0x4a130, 0x004c4c4c, }, -{W, 1, "", 0x4a134, 0x004d4d4d, }, -{W, 1, "", 0x4a138, 0x004e4e4e, }, -{W, 1, "", 0x4a13c, 0x004f4f4f, }, -{W, 1, "", 0x4a140, 0x00505050, }, -{W, 1, "", 0x4a144, 0x00515151, }, -{W, 1, "", 0x4a148, 0x00525252, }, -{W, 1, "", 0x4a14c, 0x00535353, }, -{W, 1, "", 0x4a150, 0x00545454, }, -{W, 1, "", 0x4a154, 0x00555555, }, -{W, 1, "", 0x4a158, 0x00565656, }, -{W, 1, "", 0x4a15c, 0x00575757, }, -{W, 1, "", 0x4a160, 0x00585858, }, -{W, 1, "", 0x4a164, 0x00595959, }, -{W, 1, "", 0x4a168, 0x005a5a5a, }, -{W, 1, "", 0x4a16c, 0x005b5b5b, }, -{W, 1, "", 0x4a170, 0x005c5c5c, }, -{W, 1, "", 0x4a174, 0x005d5d5d, }, -{W, 1, "", 0x4a178, 0x005e5e5e, }, -{W, 1, "", 0x4a17c, 0x005f5f5f, }, -{W, 1, "", 0x4a180, 0x00606060, }, -{W, 1, "", 0x4a184, 0x00616161, }, -{W, 1, "", 0x4a188, 0x00626262, }, -{W, 1, "", 0x4a18c, 0x00636363, }, -{W, 1, "", 0x4a190, 0x00646464, }, -{W, 1, "", 0x4a194, 0x00656565, }, -{W, 1, "", 0x4a198, 0x00666666, }, -{W, 1, "", 0x4a19c, 0x00676767, }, -{W, 1, "", 0x4a1a0, 0x00686868, }, -{W, 1, "", 0x4a1a4, 0x00696969, }, -{W, 1, "", 0x4a1a8, 0x006a6a6a, }, -{W, 1, "", 0x4a1ac, 0x006b6b6b, }, -{W, 1, "", 0x4a1b0, 0x006c6c6c, }, -{W, 1, "", 0x4a1b4, 0x006d6d6d, }, -{W, 1, "", 0x4a1b8, 0x006e6e6e, }, -{W, 1, "", 0x4a1bc, 0x006f6f6f, }, -{W, 1, "", 0x4a1c0, 0x00707070, }, -{W, 1, "", 0x4a1c4, 0x00717171, }, -{W, 1, "", 0x4a1c8, 0x00727272, }, -{W, 1, "", 0x4a1cc, 0x00737373, }, -{W, 1, "", 0x4a1d0, 0x00747474, }, -{W, 1, "", 0x4a1d4, 0x00757575, }, -{W, 1, "", 0x4a1d8, 0x00767676, }, -{W, 1, "", 0x4a1dc, 0x00777777, }, -{W, 1, "", 0x4a1e0, 0x00787878, }, -{W, 1, "", 0x4a1e4, 0x00797979, }, -{W, 1, "", 0x4a1e8, 0x007a7a7a, }, -{W, 1, "", 0x4a1ec, 0x007b7b7b, }, -{W, 1, "", 0x4a1f0, 0x007c7c7c, }, -{W, 1, "", 0x4a1f4, 0x007d7d7d, }, -{W, 1, "", 0x4a1f8, 0x007e7e7e, }, -{W, 1, "", 0x4a1fc, 0x007f7f7f, }, -{W, 1, "", 0x4a200, 0x00808080, }, -{W, 1, "", 0x4a204, 0x00818181, }, -{W, 1, "", 0x4a208, 0x00828282, }, -{W, 1, "", 0x4a20c, 0x00838383, }, -{W, 1, "", 0x4a210, 0x00848484, }, -{W, 1, "", 0x4a214, 0x00858585, }, -{W, 1, "", 0x4a218, 0x00868686, }, -{W, 1, "", 0x4a21c, 0x00878787, }, -{W, 1, "", 0x4a220, 0x00888888, }, -{W, 1, "", 0x4a224, 0x00898989, }, -{W, 1, "", 0x4a228, 0x008a8a8a, }, -{W, 1, "", 0x4a22c, 0x008b8b8b, }, -{W, 1, "", 0x4a230, 0x008c8c8c, }, -{W, 1, "", 0x4a234, 0x008d8d8d, }, -{W, 1, "", 0x4a238, 0x008e8e8e, }, -{W, 1, "", 0x4a23c, 0x008f8f8f, }, -{W, 1, "", 0x4a240, 0x00909090, }, -{W, 1, "", 0x4a244, 0x00919191, }, -{W, 1, "", 0x4a248, 0x00929292, }, -{W, 1, "", 0x4a24c, 0x00939393, }, -{W, 1, "", 0x4a250, 0x00949494, }, -{W, 1, "", 0x4a254, 0x00959595, }, -{W, 1, "", 0x4a258, 0x00969696, }, -{W, 1, "", 0x4a25c, 0x00979797, }, -{W, 1, "", 0x4a260, 0x00989898, }, -{W, 1, "", 0x4a264, 0x00999999, }, -{W, 1, "", 0x4a268, 0x009a9a9a, }, -{W, 1, "", 0x4a26c, 0x009b9b9b, }, -{W, 1, "", 0x4a270, 0x009c9c9c, }, -{W, 1, "", 0x4a274, 0x009d9d9d, }, -{W, 1, "", 0x4a278, 0x009e9e9e, }, -{W, 1, "", 0x4a27c, 0x009f9f9f, }, -{W, 1, "", 0x4a280, 0x00a0a0a0, }, -{W, 1, "", 0x4a284, 0x00a1a1a1, }, -{W, 1, "", 0x4a288, 0x00a2a2a2, }, -{W, 1, "", 0x4a28c, 0x00a3a3a3, }, -{W, 1, "", 0x4a290, 0x00a4a4a4, }, -{W, 1, "", 0x4a294, 0x00a5a5a5, }, -{W, 1, "", 0x4a298, 0x00a6a6a6, }, -{W, 1, "", 0x4a29c, 0x00a7a7a7, }, -{W, 1, "", 0x4a2a0, 0x00a8a8a8, }, -{W, 1, "", 0x4a2a4, 0x00a9a9a9, }, -{W, 1, "", 0x4a2a8, 0x00aaaaaa, }, -{W, 1, "", 0x4a2ac, 0x00ababab, }, -{W, 1, "", 0x4a2b0, 0x00acacac, }, -{W, 1, "", 0x4a2b4, 0x00adadad, }, -{W, 1, "", 0x4a2b8, 0x00aeaeae, }, -{W, 1, "", 0x4a2bc, 0x00afafaf, }, -{W, 1, "", 0x4a2c0, 0x00b0b0b0, }, -{W, 1, "", 0x4a2c4, 0x00b1b1b1, }, -{W, 1, "", 0x4a2c8, 0x00b2b2b2, }, -{W, 1, "", 0x4a2cc, 0x00b3b3b3, }, -{W, 1, "", 0x4a2d0, 0x00b4b4b4, }, -{W, 1, "", 0x4a2d4, 0x00b5b5b5, }, -{W, 1, "", 0x4a2d8, 0x00b6b6b6, }, -{W, 1, "", 0x4a2dc, 0x00b7b7b7, }, -{W, 1, "", 0x4a2e0, 0x00b8b8b8, }, -{W, 1, "", 0x4a2e4, 0x00b9b9b9, }, -{W, 1, "", 0x4a2e8, 0x00bababa, }, -{W, 1, "", 0x4a2ec, 0x00bbbbbb, }, -{W, 1, "", 0x4a2f0, 0x00bcbcbc, }, -{W, 1, "", 0x4a2f4, 0x00bdbdbd, }, -{W, 1, "", 0x4a2f8, 0x00bebebe, }, -{W, 1, "", 0x4a2fc, 0x00bfbfbf, }, -{W, 1, "", 0x4a300, 0x00c0c0c0, }, -{W, 1, "", 0x4a304, 0x00c1c1c1, }, -{W, 1, "", 0x4a308, 0x00c2c2c2, }, -{W, 1, "", 0x4a30c, 0x00c3c3c3, }, -{W, 1, "", 0x4a310, 0x00c4c4c4, }, -{W, 1, "", 0x4a314, 0x00c5c5c5, }, -{W, 1, "", 0x4a318, 0x00c6c6c6, }, -{W, 1, "", 0x4a31c, 0x00c7c7c7, }, -{W, 1, "", 0x4a320, 0x00c8c8c8, }, -{W, 1, "", 0x4a324, 0x00c9c9c9, }, -{W, 1, "", 0x4a328, 0x00cacaca, }, -{W, 1, "", 0x4a32c, 0x00cbcbcb, }, -{W, 1, "", 0x4a330, 0x00cccccc, }, -{W, 1, "", 0x4a334, 0x00cdcdcd, }, -{W, 1, "", 0x4a338, 0x00cecece, }, -{W, 1, "", 0x4a33c, 0x00cfcfcf, }, -{W, 1, "", 0x4a340, 0x00d0d0d0, }, -{W, 1, "", 0x4a344, 0x00d1d1d1, }, -{W, 1, "", 0x4a348, 0x00d2d2d2, }, -{W, 1, "", 0x4a34c, 0x00d3d3d3, }, -{W, 1, "", 0x4a350, 0x00d4d4d4, }, -{W, 1, "", 0x4a354, 0x00d5d5d5, }, -{W, 1, "", 0x4a358, 0x00d6d6d6, }, -{W, 1, "", 0x4a35c, 0x00d7d7d7, }, -{W, 1, "", 0x4a360, 0x00d8d8d8, }, -{W, 1, "", 0x4a364, 0x00d9d9d9, }, -{W, 1, "", 0x4a368, 0x00dadada, }, -{W, 1, "", 0x4a36c, 0x00dbdbdb, }, -{W, 1, "", 0x4a370, 0x00dcdcdc, }, -{W, 1, "", 0x4a374, 0x00dddddd, }, -{W, 1, "", 0x4a378, 0x00dedede, }, -{W, 1, "", 0x4a37c, 0x00dfdfdf, }, -{W, 1, "", 0x4a380, 0x00e0e0e0, }, -{W, 1, "", 0x4a384, 0x00e1e1e1, }, -{W, 1, "", 0x4a388, 0x00e2e2e2, }, -{W, 1, "", 0x4a38c, 0x00e3e3e3, }, -{W, 1, "", 0x4a390, 0x00e4e4e4, }, -{W, 1, "", 0x4a394, 0x00e5e5e5, }, -{W, 1, "", 0x4a398, 0x00e6e6e6, }, -{W, 1, "", 0x4a39c, 0x00e7e7e7, }, -{W, 1, "", 0x4a3a0, 0x00e8e8e8, }, -{W, 1, "", 0x4a3a4, 0x00e9e9e9, }, -{W, 1, "", 0x4a3a8, 0x00eaeaea, }, -{W, 1, "", 0x4a3ac, 0x00ebebeb, }, -{W, 1, "", 0x4a3b0, 0x00ececec, }, -{W, 1, "", 0x4a3b4, 0x00ededed, }, -{W, 1, "", 0x4a3b8, 0x00eeeeee, }, -{W, 1, "", 0x4a3bc, 0x00efefef, }, -{W, 1, "", 0x4a3c0, 0x00f0f0f0, }, -{W, 1, "", 0x4a3c4, 0x00f1f1f1, }, -{W, 1, "", 0x4a3c8, 0x00f2f2f2, }, -{W, 1, "", 0x4a3cc, 0x00f3f3f3, }, -{W, 1, "", 0x4a3d0, 0x00f4f4f4, }, -{W, 1, "", 0x4a3d4, 0x00f5f5f5, }, -{W, 1, "", 0x4a3d8, 0x00f6f6f6, }, -{W, 1, "", 0x4a3dc, 0x00f7f7f7, }, -{W, 1, "", 0x4a3e0, 0x00f8f8f8, }, -{W, 1, "", 0x4a3e4, 0x00f9f9f9, }, -{W, 1, "", 0x4a3e8, 0x00fafafa, }, -{W, 1, "", 0x4a3ec, 0x00fbfbfb, }, -{W, 1, "", 0x4a3f0, 0x00fcfcfc, }, -{W, 1, "", 0x4a3f4, 0x00fdfdfd, }, -{W, 1, "", 0x4a3f8, 0x00fefefe, }, -{W, 1, "", 0x4a3fc, 0x00ffffff, }, +{P, 1, "Set palette", }, {R, 1, "", _PIPEACONF, 0x00000050, }, {W, 1, "", _PIPEACONF, 0x80000050, }, {R, 1, "", _PIPEASTAT, 0x00000000, }, diff --git a/src/mainboard/google/link/i915io.h b/src/mainboard/google/link/i915io.h index 638d59e115..06114c4eb4 100644 --- a/src/mainboard/google/link/i915io.h +++ b/src/mainboard/google/link/i915io.h @@ -49,6 +49,7 @@ #define W 3 #define V 4 #define I 8 +#define P 16 struct iodef { unsigned char op; |