diff options
author | Stewart Smith <stewart@linux.ibm.com> | 2019-07-15 12:00:44 +1000 |
---|---|---|
committer | Oliver O'Halloran <oohall@gmail.com> | 2019-07-19 17:46:22 +1000 |
commit | 067de39aa3334248232ea09d3215ae7055a811f3 (patch) | |
tree | db26b27f4d4a0e43a90cd325319c7c801bfbf43f /hw | |
parent | 1a02a18937c0d331ebc6c599d95e7df54d556aa0 (diff) | |
download | skiboot-067de39aa3334248232ea09d3215ae7055a811f3.zip skiboot-067de39aa3334248232ea09d3215ae7055a811f3.tar.gz skiboot-067de39aa3334248232ea09d3215ae7055a811f3.tar.bz2 |
Move ec/ code to Rhesus platform
The embedded controller that Rhesus uses is exclusive to that platform,
make it purely part of tha platform
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/Makefile.inc | 1 | ||||
-rw-r--r-- | hw/ec/Makefile.inc | 8 | ||||
-rw-r--r-- | hw/ec/gpio.c | 87 | ||||
-rw-r--r-- | hw/ec/makefile | 8 |
4 files changed, 0 insertions, 104 deletions
diff --git a/hw/Makefile.inc b/hw/Makefile.inc index 0e8c257..e265bd0 100644 --- a/hw/Makefile.inc +++ b/hw/Makefile.inc @@ -13,7 +13,6 @@ HW_OBJS += lpc-port80h.o HW=hw/built-in.a include $(SRC)/hw/fsp/Makefile.inc -include $(SRC)/hw/ec/Makefile.inc include $(SRC)/hw/ast-bmc/Makefile.inc include $(SRC)/hw/ipmi/Makefile.inc diff --git a/hw/ec/Makefile.inc b/hw/ec/Makefile.inc deleted file mode 100644 index f944d4d..0000000 --- a/hw/ec/Makefile.inc +++ /dev/null @@ -1,8 +0,0 @@ -# -*-Makefile-*- -# Sapphire EC makefile - -SUBDIRS += hw/ec -EC_OBJS = gpio.o -EC=hw/ec/built-in.a - -$(EC): $(EC_OBJS:%=hw/ec/%) diff --git a/hw/ec/gpio.c b/hw/ec/gpio.c deleted file mode 100644 index 0a2223d..0000000 --- a/hw/ec/gpio.c +++ /dev/null @@ -1,87 +0,0 @@ -/* Copyright 2013-2014 Google Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - * implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include <stdint.h> -#include "ec/config.h" -#include "ec/gpio.h" - -int ec_gpio_setup(EcGpioPort port, uint8_t pin, - int is_output, int pullup_enable) -{ - uint8_t ddr_reg; - if (pin > 7) { - return -1; - } - - /* Set data direction */ - ec_outb(EC_GPIO_INDEX, - port * EC_GPIO_PORT_SKIP + EC_GPIO_DDR_OFFSET); - ddr_reg = ec_inb(EC_GPIO_DATA); - if (is_output) { - ddr_reg |= (1 << pin); - } else { - ddr_reg &= ~(1 << pin); - } - ec_outb(EC_GPIO_DATA, ddr_reg); - - /* Set pullup enable for output GPOs */ - if (is_output) - { - uint8_t pup_reg; - ec_outb(EC_GPIO_INDEX, - port * EC_GPIO_PORT_SKIP + EC_GPIO_PUP_OFFSET); - pup_reg = ec_inb(EC_GPIO_DATA); - if (pullup_enable) { - pup_reg |= (1 << pin); - } else { - pup_reg &= ~(1 << pin); - } - ec_outb(EC_GPIO_DATA, pup_reg); - } - - return 0; -} - -int ec_gpio_read(EcGpioPort port, uint8_t pin) -{ - uint8_t pin_reg; - if (pin > 7) { - return -1; - } - - ec_outb(EC_GPIO_INDEX, - port * EC_GPIO_PORT_SKIP + EC_GPIO_PIN_OFFSET); - pin_reg = ec_inb(EC_GPIO_DATA); - return !!(pin_reg & (1 << pin)); -} - -int ec_gpio_set(EcGpioPort port, uint8_t pin, int val) -{ - uint8_t data_reg; - if (pin > 7) { - return -1; - } - - ec_outb(EC_GPIO_INDEX, - port * EC_GPIO_PORT_SKIP + EC_GPIO_DATA_OFFSET); - data_reg = ec_inb(EC_GPIO_DATA); - if (val) { - data_reg |= (1 << pin); - } else { - data_reg &= ~(1 << pin); - } - ec_outb(EC_GPIO_DATA, data_reg); - return 0; -} diff --git a/hw/ec/makefile b/hw/ec/makefile deleted file mode 100644 index e6ceafa..0000000 --- a/hw/ec/makefile +++ /dev/null @@ -1,8 +0,0 @@ -ROOTPATH = ../../.. -MODULE = ec - -OBJS = cmosdd.o gpio.o rhesus.o hostboot.o - -SUBDIRS = test.d - -include ${ROOTPATH}/config.mk |