diff options
author | Stefan Reinauer <stepan@coresystems.de> | 2010-01-17 13:51:48 +0000 |
---|---|---|
committer | Stefan Reinauer <stepan@openbios.org> | 2010-01-17 13:51:48 +0000 |
commit | f00052afbfffe87a3f0e07bbb5b8453f48ad19f5 (patch) | |
tree | 8aa1bbfe5e1e29f23746e3469ae3ec049d9d4c9b | |
parent | 55426dfd577a6f7eddb5e4918ad0401537807ae9 (diff) |
Add support for Renesas M3885x Embedded Controller
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Peter Stuge <peter@stuge.se>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5028 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
-rw-r--r-- | src/superio/Kconfig | 1 | ||||
-rw-r--r-- | src/superio/Makefile.inc | 1 | ||||
-rw-r--r-- | src/superio/renesas/Kconfig | 2 | ||||
-rw-r--r-- | src/superio/renesas/Makefile.inc | 1 | ||||
-rw-r--r-- | src/superio/renesas/m3885x/Config.lb | 21 | ||||
-rw-r--r-- | src/superio/renesas/m3885x/Makefile.inc | 20 | ||||
-rw-r--r-- | src/superio/renesas/m3885x/chip.h | 28 | ||||
-rw-r--r-- | src/superio/renesas/m3885x/superio.c | 79 |
8 files changed, 153 insertions, 0 deletions
diff --git a/src/superio/Kconfig b/src/superio/Kconfig index 65ebf4a53e..7526428343 100644 --- a/src/superio/Kconfig +++ b/src/superio/Kconfig @@ -2,6 +2,7 @@ source src/superio/fintek/Kconfig source src/superio/intel/Kconfig source src/superio/ite/Kconfig source src/superio/nsc/Kconfig +source src/superio/renesas/Kconfig source src/superio/serverengines/Kconfig source src/superio/smsc/Kconfig source src/superio/via/Kconfig diff --git a/src/superio/Makefile.inc b/src/superio/Makefile.inc index d662a3fb79..88c02bdc70 100644 --- a/src/superio/Makefile.inc +++ b/src/superio/Makefile.inc @@ -2,6 +2,7 @@ subdirs-y += fintek subdirs-y += intel subdirs-y += ite subdirs-y += nsc +subdirs-y += renesas # subdirs-y += serverengines subdirs-y += smsc subdirs-y += via diff --git a/src/superio/renesas/Kconfig b/src/superio/renesas/Kconfig new file mode 100644 index 0000000000..a61090fdd4 --- /dev/null +++ b/src/superio/renesas/Kconfig @@ -0,0 +1,2 @@ +config SUPERIO_RENESAS_M3885X + bool diff --git a/src/superio/renesas/Makefile.inc b/src/superio/renesas/Makefile.inc new file mode 100644 index 0000000000..f15642276f --- /dev/null +++ b/src/superio/renesas/Makefile.inc @@ -0,0 +1 @@ +subdirs-y += m3885x diff --git a/src/superio/renesas/m3885x/Config.lb b/src/superio/renesas/m3885x/Config.lb new file mode 100644 index 0000000000..3828fd4161 --- /dev/null +++ b/src/superio/renesas/m3885x/Config.lb @@ -0,0 +1,21 @@ +## +## This file is part of the coreboot project. +## +## Copyright (C) 2009 coresystems GmbH +## +## 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 +## + +config chip.h +object superio.o diff --git a/src/superio/renesas/m3885x/Makefile.inc b/src/superio/renesas/m3885x/Makefile.inc new file mode 100644 index 0000000000..1b85138229 --- /dev/null +++ b/src/superio/renesas/m3885x/Makefile.inc @@ -0,0 +1,20 @@ +## +## This file is part of the coreboot project. +## +## Copyright (C) 2009 coresystems GmbH +## +## 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 +## + +obj-$(CONFIG_SUPERIO_RENESAS_M3885X) += superio.o diff --git a/src/superio/renesas/m3885x/chip.h b/src/superio/renesas/m3885x/chip.h new file mode 100644 index 0000000000..b333d1744b --- /dev/null +++ b/src/superio/renesas/m3885x/chip.h @@ -0,0 +1,28 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2009 coresystems GmbH + * + * 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 <device/device.h> +#include <pc80/keyboard.h> + +extern struct chip_operations superio_renesas_m3885x_ops; + +struct superio_renesas_m3885x_config { + struct pc_keyboard keyboard; +}; + diff --git a/src/superio/renesas/m3885x/superio.c b/src/superio/renesas/m3885x/superio.c new file mode 100644 index 0000000000..3ed4943200 --- /dev/null +++ b/src/superio/renesas/m3885x/superio.c @@ -0,0 +1,79 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2009 coresystems GmbH + * + * 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 <arch/io.h> +#include <device/device.h> +#include <device/pnp.h> +#include <console/console.h> +#include <device/smbus.h> +#include <string.h> +#include <bitops.h> +#include <uart8250.h> +#include <assert.h> +#include <stdlib.h> +#include "chip.h" + +void set_kbc_ps2_mode(void); +void m3885_configure_multikey(void); + +static void m3885x_init(device_t dev) +{ + struct superio_renesas_m3885x_config *conf = dev->chip_info; + + if (!dev->enabled) + return; + + printk_debug("Renesas M3885x: Initializing keyboard.\n"); + set_kbc_ps2_mode(); + init_pc_keyboard(0x60, 0x64, &conf->keyboard); + m3885_configure_multikey(); +} + + +static void m3885x_read_resources(device_t dev) +{ + // nothing, but this function avoids an error on serial console. +} + +static void m3885x_enable_resources(device_t dev) +{ + // nothing, but this function avoids an error on serial console. +} + +static struct device_operations ops = { + .init = m3885x_init, + .read_resources = m3885x_read_resources, + .enable_resources = m3885x_enable_resources +}; + +static struct pnp_info pnp_dev_info[] = { + { &ops, 0, 0, { 0, 0 }, } +}; + +static void enable_dev(device_t dev) +{ + pnp_enable_devices(dev, &pnp_ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info); +} + +struct chip_operations superio_renesas_m3885x_ops = { + CHIP_NAME("Renesas M3885x Super I/O") + .enable_dev = enable_dev, +}; + + |