2020-04-03 01:21:01 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2011-11-15 14:27:07 +01:00
|
|
|
|
2019-11-28 12:59:44 +01:00
|
|
|
#include <amdblocks/acpimmio.h>
|
2011-11-15 14:27:07 +01:00
|
|
|
#include <console/console.h>
|
2017-09-10 05:30:54 +02:00
|
|
|
#include <delay.h>
|
2011-11-15 14:27:07 +01:00
|
|
|
#include <device/device.h>
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Southstation using SB GPIO 17/18 to control the Red/Green LED
|
|
|
|
* These two LEDs can be used to show the OS booting status.
|
|
|
|
*/
|
|
|
|
static void southstation_led_init(void)
|
|
|
|
{
|
|
|
|
/* multi-function pins switch to GPIO0-35 */
|
2019-12-01 17:42:04 +01:00
|
|
|
pm_write8(0xea, (pm_read8(0xea) & 0xfe) | 1);
|
2011-11-15 14:27:07 +01:00
|
|
|
|
|
|
|
/* select IOMux to function2, corresponds to GPIO */
|
2019-12-01 17:42:04 +01:00
|
|
|
iomux_write8(0x11, (iomux_read8(0x11) & 0xfc) | 2);
|
|
|
|
iomux_write8(0x12, (iomux_read8(0x12) & 0xfc) | 2);
|
2011-11-15 14:27:07 +01:00
|
|
|
|
|
|
|
/* Lighting test */
|
2019-12-01 17:42:04 +01:00
|
|
|
gpio_100_write8(0x11, 0x08); //output high
|
|
|
|
gpio_100_write8(0x12, 0x08);
|
2011-11-15 14:27:07 +01:00
|
|
|
mdelay(100);
|
2019-12-01 17:42:04 +01:00
|
|
|
gpio_100_write8(0x11, 0x48); //output low
|
|
|
|
gpio_100_write8(0x12, 0x48);
|
2011-11-15 14:27:07 +01:00
|
|
|
}
|
|
|
|
|
2013-02-26 15:56:11 +01:00
|
|
|
/**********************************************
|
|
|
|
* Enable the dedicated functions of the board.
|
|
|
|
**********************************************/
|
2018-05-04 19:42:25 +02:00
|
|
|
static void mainboard_enable(struct device *dev)
|
2011-11-15 14:27:07 +01:00
|
|
|
{
|
|
|
|
printk(BIOS_INFO, "Mainboard " CONFIG_MAINBOARD_PART_NUMBER " Enable.\n");
|
|
|
|
southstation_led_init();
|
2013-03-07 16:54:36 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Initialize ASF registers to an arbitrary address because someone
|
|
|
|
* long ago set things up this way inside the SPD read code. The
|
|
|
|
* SPD read code has been made generic and moved out of the board
|
|
|
|
* directory, so the ASF init is being done here.
|
|
|
|
*/
|
2019-11-28 12:59:44 +01:00
|
|
|
pm_write8(0x29, 0x80);
|
|
|
|
pm_write8(0x28, 0x61);
|
2011-11-15 14:27:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
struct chip_operations mainboard_ops = {
|
2013-02-23 21:31:23 +01:00
|
|
|
.enable_dev = mainboard_enable,
|
2011-11-15 14:27:07 +01:00
|
|
|
};
|