aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard')
-rw-r--r--src/mainboard/google/snow/ramstage.c34
-rw-r--r--src/mainboard/intel/wtm2/i915.c114
2 files changed, 84 insertions, 64 deletions
diff --git a/src/mainboard/google/snow/ramstage.c b/src/mainboard/google/snow/ramstage.c
index 72f830dec6..93979b2a60 100644
--- a/src/mainboard/google/snow/ramstage.c
+++ b/src/mainboard/google/snow/ramstage.c
@@ -42,40 +42,6 @@
#define DRAM_SIZE CONFIG_DRAM_SIZE_MB
#define DRAM_END (DRAM_START + DRAM_SIZE) /* plus one... */
-int vbe_mode_info_valid(void);
-int vbe_mode_info_valid(void)
-{
- return 1;
-}
-
-void fill_lb_framebuffer(struct lb_framebuffer *framebuffer);
-void fill_lb_framebuffer(struct lb_framebuffer *framebuffer)
-{
- /*
- * The address returned points at the LCD colormap base. The
- * 64KiB offset points at the LCD base.
- */
- framebuffer->physical_address =
- (u32)cbmem_find(CBMEM_ID_CONSOLE) + 64*KiB;
- printk(BIOS_SPEW, "%s: framebuffer->physical address is 0x%llx\n",
- __func__, framebuffer->physical_address);
-
- framebuffer->x_resolution = 1366;
- framebuffer->y_resolution = 768;
- framebuffer->bits_per_pixel = 16;
- framebuffer->bytes_per_line =
- (framebuffer->x_resolution * framebuffer->bits_per_pixel) / 8;
-
- framebuffer->red_mask_pos = 11;
- framebuffer->red_mask_size = 5;
- framebuffer->green_mask_pos = 6;
- framebuffer->green_mask_size = 5;
- framebuffer->blue_mask_pos = 0;
- framebuffer->blue_mask_size = 5;
- framebuffer->reserved_mask_pos = 0;
- framebuffer->reserved_mask_size = 0;
-}
-
void hardwaremain(void);
void main(void)
diff --git a/src/mainboard/intel/wtm2/i915.c b/src/mainboard/intel/wtm2/i915.c
index 8103016c51..9d0c27d850 100644
--- a/src/mainboard/intel/wtm2/i915.c
+++ b/src/mainboard/intel/wtm2/i915.c
@@ -139,42 +139,96 @@ static unsigned long globalmicroseconds(void)
static int i915_init_done = 0;
-int vbe_mode_info_valid(void)
+/* fill the palette. This runs when the P opcode is hit. */
+static void palette(void)
{
- return i915_init_done;
+ int i;
+ unsigned long color = 0;
+
+ for(i = 0; i < 256; i++, color += 0x010101){
+ io_i915_WRITE32(color, _LGC_PALETTE_A + (i<<2));
+ }
}
-void fill_lb_framebuffer(struct lb_framebuffer *framebuffer)
-{
- printk(BIOS_SPEW, "fill_lb_framebuffer: graphics is %p\n",
- (void *)graphics);
- /* Please note: these will be filled from EDID.
- * these values are a placeholder.
- */
- framebuffer->physical_address = graphics;
- /* these are a fantasy, but will be fixed once we're getting
- * info from the hardware. Hard to get from the device tree,
- * which is arguably a defect of the device tree. Bear with me,
- * this Will Get Fixed.
- */
- framebuffer->x_resolution = 1960;
- framebuffer->y_resolution = 1700;
- framebuffer->bytes_per_line = 1960*4;
- framebuffer->bits_per_pixel = 32;
- framebuffer->red_mask_pos = 16;
- framebuffer->red_mask_size = 8;
- framebuffer->green_mask_pos = 8;
- framebuffer->green_mask_size = 8;
- framebuffer->blue_mask_pos = 0;
- framebuffer->blue_mask_size = 8;
- framebuffer->reserved_mask_pos = 0;
- framebuffer->reserved_mask_size = 0;
+static unsigned long times[4096];
+static int run(int index)
+{
+ int i, prev = 0;
+ struct iodef *id, *lastidread = 0;
+ unsigned long u, t;
+ if (index >= niodefs)
+ return index;
+ /* state machine! */
+ for(i = index, id = &iodefs[i]; 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, "\texpect %08lx\n", id->data);
+ /* we're looking for something. */
+ if (lastidread->addr == id->addr){
+ /* they're going to be polling.
+ * just do it 1000 times
+ */
+ for(t = 0; t < 1000 && id->data != u; t++){
+ u = READ32(id->addr);
+ }
+ if (verbose & vspin) printk(BIOS_SPEW,
+ "%s: # loops %ld got %08lx want %08lx\n",
+ regname(id->addr),
+ t, u, id->data);
+ }
+ lastidread = id;
+ break;
+ case W:
+ WRITE32(id->data, id->addr);
+ if (id->addr == PCH_PP_CONTROL){
+ if (verbose & vio)
+ printk(BIOS_SPEW, "PCH_PP_CONTROL\n");
+ switch(id->data & 0xf){
+ case 8: break;
+ case 7: break;
+ default: udelay(100000);
+ if (verbose & vio)
+ printk(BIOS_SPEW, "U %d\n", 100000);
+ }
+ }
+ break;
+ case V:
+ if (id->count < 8){
+ prev = verbose;
+ verbose = id->count;
+ } else {
+ verbose = prev;
+ }
+ printk(BIOS_SPEW, "Change verbosity to %d\n", verbose);
+ break;
+ case I:
+ printk(BIOS_SPEW, "run: return %d\n", i+1);
+ return i+1;
+ break;
+ default:
+ printk(BIOS_SPEW, "BAD TABLE, opcode %d @ %d\n", id->op, i);
+ return -1;
+ }
+ if (id->udelay)
+ udelay(id->udelay);
+ if (i < ARRAY_SIZE(times))
+ times[i] = globalmicroseconds();
+ }
+ printk(BIOS_SPEW, "run: return %d\n", i);
+ return i+1;
}
-int i915lightup(unsigned int physbase,
- unsigned int iobase,
- unsigned int mmio,
+int i915lightup(unsigned int physbase, unsigned int iobase, unsigned int mmio,
unsigned int gfx);
int i915lightup(unsigned int pphysbase, unsigned int piobase,