Commit Graph

31 Commits

Author SHA1 Message Date
Kevin O'Connor 2f2ec113be vgautil: Add new header file with misc function and variable definitions
Move the generic function and variable definitions from vgabios.h to a
new file vgautil.h.  This reduces the size and complexity of
vgabios.h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-08-05 11:28:19 -04:00
Kevin O'Connor 2d2fa31b37 Move function definitions for output.c from util.h to new file output.h.
Also, sort the order of include files in the c files.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18 20:48:34 -04:00
Kevin O'Connor fa9c66a656 Rename util.c to string.c and introduce string.h.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18 20:48:34 -04:00
Kevin O'Connor 5d369d8d9e Move code centered around specific hardware devices to src/hw/
Move many C files from the src/ directory to the new src/hw/ directory.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-02 20:48:46 -04:00
Christian Gmeiner 1337eb38bf geodevga: fix wrong define name
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2013-02-15 22:52:18 -05:00
Christian Gmeiner 0f5628d164 geodevga: add debug to msr functions
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2013-02-15 22:52:18 -05:00
Christian Gmeiner 42f33ffd9a geodevga: move output setup to own function
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2013-02-15 22:52:18 -05:00
Christian Gmeiner 320570821a geodevga: move framebuffer setup
Framebuffer setup has nothing to do with dc_setup(..) so
move it to  geodevga_init(..).

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2013-02-15 22:52:18 -05:00
Christian Gmeiner bb7e54a1b2 geodevga: fix errors in geode_fp_* functions
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2013-02-15 22:52:18 -05:00
Kevin O'Connor d83c87bb20 Normalize POST initialization function name suffixes.
The POST phase has to invoke many initialization functions, and these
functions can have complex inter-dependencies.  Try to categorize the
functions into 4 classes:

preinit - functions called very early in POST where function ordering
    is very important and the code has limited access to other
    interfaces.

init - functions that initialize internal interfaces and standard
    external interfaces.  This code is generally not dependent on
    particular hardware and typically does not communicate directly
    with any hardware devices.

setup - functions which access hardware or are dependent on particular
    hardware or platform devices.

prepboot - functions that finalize internal interfaces and that
    prepare for the boot phase.

This patch attempts to normalize the suffixes - functions that used
_init(), _setup(), _finalize(), or similar that did not follow the
above pattern were renamed.  Other than function name changes, there
should be no code impact to this patch.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-05 20:00:29 -05:00
Christian Gmeiner 02203b5302 geodevga: Setup flat panel if needed
This patch does basic setup of the flat panel and turns the
panel on.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2012-10-07 22:05:42 -04:00
Christian Gmeiner eac884ddf3 geodevga: Setup output based on .config
The geode hardware can be configured to use different
outputs. This patch adds support this feature based on
the current .config

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2012-10-07 22:05:19 -04:00
Christian Gmeiner 119ece9b82 geodevga: Add functions to work with fp register
The Flat Panel Display Controller belongs to the Video
Processor unit but its register are starting at offset
0x400. Provide functions to work with fp register.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2012-10-07 22:04:12 -04:00
Christian Gmeiner 286e01365d geodevga: Rename defines to better match a well defined naming schema
The following nameing schema is used:
    PART_REGISTER_BIT_DESCRIPTION

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2012-10-07 22:03:46 -04:00
Kevin O'Connor ef7f73fa23 geodevga: Access global variables using GET_GLOBAL/SET_VGA macros.
The vgabios runs in 16bit mode so all global variables must be
accessed via macros.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-09-16 13:24:30 -04:00
Kevin O'Connor f47461f455 Geode vga: Use standard format read/write_mask register functions.
Rework the Geode code to use the same style register accessors as the
standard vga code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-09-03 12:32:01 -04:00
Christian Gmeiner d136fd7944 Add helper functions to access DC and VP register
This change introduces some helper functions, which are making
the code more readable and easier to debug.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2012-09-03 12:09:13 -04:00
Christian Gmeiner 11ebc7d3de Change return values for vp_setup() and dc_setup()
There is no reason to have a return code for vp_setup()
and dc_setup(). So get rid of them.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2012-09-03 12:09:13 -04:00
Christian Gmeiner 7bec6dba51 Add global struct geode
This struct is used to store some PCI BAR values, which are used
during hw init.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2012-09-03 12:04:56 -04:00
Christian Gmeiner 517f7426a9 Update VBE variables
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2012-09-03 12:04:56 -04:00
Christian Gmeiner 9de339d1f5 Add framebuffer size detection
It is possible to read out the framebuffer size via msr. The size
information is needed for VESA later.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2012-09-03 12:04:56 -04:00
Christian Gmeiner 0155aef19a Remove Extened CRTC Register functions
As the access the DC registers via memory, we dont need to
work with the extended CRTC register to setup the DC-VGA-mapping.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2012-09-03 12:04:55 -04:00
Christian Gmeiner efb9784015 Remove all dc_ functions as they are not needed anymore
As we access teh DC registers via memory we do not need all
the DC-VGA-mapping functions anymore.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2012-09-03 12:04:55 -04:00
Christian Gmeiner c13c181a9d Access DC registers via geode_mem[Read|Write]
There is no reason to access the DC registers via VGA
memory mapping if we could the access via memory.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2012-09-03 12:04:55 -04:00
Kevin O'Connor 8cf8f8e6ce vgabios: Check that the PCI BDF passed in is valid before using.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-19 21:34:44 -05:00
Kevin O'Connor 707d2168f5 vgabios: Use regular pci_config_readl func in geode code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-16 12:03:19 -05:00
Kevin O'Connor 69b01cbdb3 vgabios: Don't have geode code peak into stdvga mode struct.
Create a wrapper (stdvga_override_crtc) so the Geode code doesn't need
to access the stdvga mode tables directly.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-16 12:03:14 -05:00
Kevin O'Connor 2c23a7ab6a vgabios: Use standard VGA IO wrappers in geodevga.c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-16 11:59:32 -05:00
Kevin O'Connor 10dff3db24 vgabios: Extract out common parts of struct vgamode_s.
Extract out the fields in 'struct vgamode_s' that are used in the main
code.  The remaining fields are specific to the standard vga hardware
driver.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-14 17:19:25 -05:00
Nils 24ddd8678c vgabios: Add the geode GX2 functionality.
Signed-off-by: Nils Jacobs <njacobs8 at adsltotaal.nl>
2012-01-14 12:15:14 -05:00
Nils 31eabf9ba8 vgabios: Make the naming in the LX code generic to Geode.
Signed-off-by: Nils Jacobs <njacobs8 at adsltotaal.nl>
2012-01-14 12:11:41 -05:00