commit
ce12a8c1a9
@ -1,39 +0,0 @@ |
||||
/*
|
||||
* This file is part of the libpayload project. |
||||
* |
||||
* Copyright (C) 2008 Advanced Micro Devices, Inc. |
||||
* Copyright (C) 2009 coresystems GmbH |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions |
||||
* are met: |
||||
* 1. Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* 2. Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* 3. The name of the author may not be used to endorse or promote products |
||||
* derived from this software without specific prior written permission. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND |
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE |
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
||||
* SUCH DAMAGE. |
||||
*/ |
||||
|
||||
#include <asm/arch-coreboot/sysinfo.h> |
||||
|
||||
/*
|
||||
* This needs to be in the .data section so that it's copied over during |
||||
* relocation. By default it's put in the .bss section which is simply filled |
||||
* with zeroes when transitioning from "ROM", which is really RAM, to other |
||||
* RAM. |
||||
*/ |
||||
struct sysinfo_t lib_sysinfo __attribute__((section(".data"))); |
@ -0,0 +1,17 @@ |
||||
/*
|
||||
* Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
||||
* Use of this source code is governed by a BSD-style license that can be |
||||
* found in the LICENSE file. |
||||
* |
||||
* Alternatively, this software may be distributed under the terms of the |
||||
* GNU General Public License ("GPL") version 2 as published by the Free |
||||
* Software Foundation. |
||||
*/ |
||||
|
||||
#include <common.h> |
||||
|
||||
unsigned long timer_get_us(void) |
||||
{ |
||||
printf("timer_get_us used but not implemented.\n"); |
||||
return 0; |
||||
} |
@ -1,33 +0,0 @@ |
||||
/* |
||||
* Copyright (c) 2011 The Chromium OS Authors. |
||||
* (C) Copyright 2008 |
||||
* Graeme Russ, graeme.russ@gmail.com.
|
||||
* |
||||
* See file CREDITS for list of people who contributed to this |
||||
* project. |
||||
* |
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as |
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version. |
||||
* |
||||
* This program is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU General Public License |
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
||||
* MA 02111-1307 USA |
||||
*/ |
||||
|
||||
.section .bios, "ax" |
||||
.code16 |
||||
.globl realmode_reset
|
||||
.hidden realmode_reset
|
||||
.type realmode_reset, @function
|
||||
realmode_reset: |
||||
|
||||
1: hlt |
||||
jmp 1 |
@ -0,0 +1,30 @@ |
||||
/dts-v1/; |
||||
|
||||
/ { |
||||
#address-cells = <1>; |
||||
#size-cells = <1>; |
||||
model = "Google Alex"; |
||||
compatible = "google,alex", "intel,atom-pineview"; |
||||
|
||||
config { |
||||
silent_console = <0>; |
||||
}; |
||||
|
||||
aliases { |
||||
console = "/serial@e0401000"; |
||||
}; |
||||
|
||||
serial@e0401000 { |
||||
compatible = "ns16550"; |
||||
reg = <0xe0401000 0x40>; |
||||
id = <1>; |
||||
reg-shift = <1>; |
||||
baudrate = <115200>; |
||||
clock-frequency = <4000000>; |
||||
multiplier = <1>; |
||||
status = "ok"; |
||||
}; |
||||
|
||||
chosen { }; |
||||
memory { device_type = "memory"; reg = <0 0>; }; |
||||
}; |
@ -0,0 +1,67 @@ |
||||
/*
|
||||
* Copyright (C) 2011 The ChromiumOS Authors. All rights reserved. |
||||
* |
||||
* This program is free software; you can redistribute it and/or modify |
||||
* it under the terms of the GNU General Public License as published by |
||||
* the Free Software Foundation; version 2 of the License. |
||||
* |
||||
* This program is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU General Public License |
||||
* along with this program; if not, write to the Free Software |
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA |
||||
*/ |
||||
|
||||
#include <common.h> |
||||
|
||||
#ifndef CONFIG_SYS_COREBOOT |
||||
#error This driver requires coreboot |
||||
#endif |
||||
|
||||
#include <asm/arch/sysinfo.h> |
||||
|
||||
struct cbmem_console { |
||||
u32 buffer_size; |
||||
u32 buffer_cursor; |
||||
u8 buffer_body[0]; |
||||
} __attribute__ ((__packed__)); |
||||
|
||||
static struct cbmem_console *cbmem_console_p; |
||||
|
||||
void cbmemc_putc(char data) |
||||
{ |
||||
int cursor; |
||||
|
||||
cursor = cbmem_console_p->buffer_cursor++; |
||||
if (cursor < cbmem_console_p->buffer_size) |
||||
cbmem_console_p->buffer_body[cursor] = data; |
||||
} |
||||
|
||||
void cbmemc_puts(const char *str) |
||||
{ |
||||
char c; |
||||
|
||||
while ((c = *str++) != 0) |
||||
cbmemc_putc(c); |
||||
} |
||||
|
||||
int cbmemc_init(void) |
||||
{ |
||||
int rc; |
||||
struct stdio_dev cons_dev; |
||||
cbmem_console_p = lib_sysinfo.cbmem_cons; |
||||
|
||||
memset(&cons_dev, 0, sizeof(cons_dev)); |
||||
|
||||
strcpy(cons_dev.name, "cbmem"); |
||||
cons_dev.flags = DEV_FLAGS_OUTPUT; /* Output only */ |
||||
cons_dev.putc = cbmemc_putc; |
||||
cons_dev.puts = cbmemc_puts; |
||||
|
||||
rc = stdio_register(&cons_dev); |
||||
|
||||
return (rc == 0) ? 1 : rc; |
||||
} |
@ -0,0 +1,101 @@ |
||||
/*
|
||||
* coreboot Framebuffer driver. |
||||
* |
||||
* Copyright (C) 2011 The Chromium OS authors |
||||
* |
||||
* See file CREDITS for list of people who contributed to this |
||||
* project. |
||||
* |
||||
* This program is free software; you can redistribute it and/or |
||||
* modify it under the terms of the GNU General Public License as |
||||
* published by the Free Software Foundation; either version 2 of |
||||
* the License, or (at your option) any later version. |
||||
* |
||||
* This program is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU General Public License |
||||
* along with this program; if not, write to the Free Software |
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
||||
* MA 02111-1307 USA |
||||
*/ |
||||
|
||||
#include <common.h> |
||||
#include <asm/arch/tables.h> |
||||
#include <asm/arch/sysinfo.h> |
||||
#include <video_fb.h> |
||||
#include "videomodes.h" |
||||
|
||||
/*
|
||||
* The Graphic Device |
||||
*/ |
||||
GraphicDevice ctfb; |
||||
|
||||
static int parse_coreboot_table_fb(GraphicDevice *gdev) |
||||
{ |
||||
struct cb_framebuffer *fb = lib_sysinfo.framebuffer; |
||||
|
||||
/* If there is no framebuffer structure, bail out and keep
|
||||
* running on the serial console. |
||||
*/ |
||||
if (!fb) |
||||
return 0; |
||||
|
||||
gdev->winSizeX = fb->x_resolution; |
||||
gdev->winSizeY = fb->y_resolution; |
||||
|
||||
gdev->plnSizeX = fb->x_resolution; |
||||
gdev->plnSizeY = fb->y_resolution; |
||||
|
||||
gdev->gdfBytesPP = fb->bits_per_pixel / 8; |
||||
|
||||
switch (fb->bits_per_pixel) { |
||||
case 24: |
||||
gdev->gdfIndex = GDF_32BIT_X888RGB; |
||||
break; |
||||
case 16: |
||||
gdev->gdfIndex = GDF_16BIT_565RGB; |
||||
break; |
||||
default: |
||||
gdev->gdfIndex = GDF__8BIT_INDEX; |
||||
break; |
||||
} |
||||
|
||||
gdev->isaBase = CONFIG_SYS_ISA_IO_BASE_ADDRESS; |
||||
gdev->pciBase = (unsigned int)fb->physical_address; |
||||
|
||||
gdev->frameAdrs = (unsigned int)fb->physical_address; |
||||
gdev->memSize = fb->bytes_per_line * fb->y_resolution; |
||||
|
||||
gdev->vprBase = (unsigned int)fb->physical_address; |
||||
gdev->cprBase = (unsigned int)fb->physical_address; |
||||
|
||||
return 1; |
||||
} |
||||
|
||||
void *video_hw_init(void) |
||||
{ |
||||
GraphicDevice *gdev = &ctfb; |
||||
int bits_per_pixel; |
||||
|
||||
printf("Video: "); |
||||
|
||||
if (!parse_coreboot_table_fb(gdev)) { |
||||
printf("No video mode configured in coreboot!\n"); |
||||
return NULL; |
||||
} |
||||
|
||||
bits_per_pixel = gdev->gdfBytesPP * 8; |
||||
|
||||
/* fill in Graphic device struct */ |
||||
sprintf(gdev->modeIdent, "%dx%dx%d", gdev->winSizeX, gdev->winSizeY, |
||||
bits_per_pixel); |
||||
printf("%s\n", gdev->modeIdent); |
||||
|
||||
memset((void *)gdev->pciBase, 0, |
||||
gdev->winSizeX * gdev->winSizeY * gdev->gdfBytesPP); |
||||
|
||||
return (void *)gdev; |
||||
} |
Loading…
Reference in new issue