summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg/Drivers
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2017-11-16 16:30:55 +0000
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2017-11-30 16:08:36 +0000
commitc13f36654b5c122c7a75d89216535cc0bd5462ff (patch)
treeb84d3bcc97aaee639ce22b3987be0fc7a7a9684d /ArmPlatformPkg/Drivers
parentef120b7d639b78c7942e07a2a5dadc3d657fcfd7 (diff)
downloadedk2-c13f36654b5c122c7a75d89216535cc0bd5462ff.zip
edk2-c13f36654b5c122c7a75d89216535cc0bd5462ff.tar.gz
edk2-c13f36654b5c122c7a75d89216535cc0bd5462ff.tar.bz2
ArmPlatformPkg: move internal PL061 header into driver directory
Move the internal PL061 GPIO header file into the driver directory. It shouldn't be referenced directly by other modules anyway. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'ArmPlatformPkg/Drivers')
-rw-r--r--ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c3
-rw-r--r--ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.h49
2 files changed, 51 insertions, 1 deletions
diff --git a/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c b/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c
index 81b9f6d..9b36df9 100644
--- a/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c
+++ b/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c
@@ -27,7 +27,8 @@
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Protocol/EmbeddedGpio.h>
-#include <Drivers/PL061Gpio.h>
+
+#include "PL061Gpio.h"
PLATFORM_GPIO_CONTROLLER *mPL061PlatformGpio;
diff --git a/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.h b/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.h
new file mode 100644
index 0000000..308f69f
--- /dev/null
+++ b/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.h
@@ -0,0 +1,49 @@
+/** @file
+*
+* Copyright (c) 2011-2012, ARM Limited. All rights reserved.
+*
+* This program and the accompanying materials
+* are licensed and made available under the terms and conditions of the BSD License
+* which accompanies this distribution. The full text of the license may be found at
+* http://opensource.org/licenses/bsd-license.php
+*
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+*
+**/
+
+
+#ifndef __PL061_GPIO_H__
+#define __PL061_GPIO_H__
+
+#include <Protocol/EmbeddedGpio.h>
+
+// PL061 GPIO Registers
+#define PL061_GPIO_DATA_REG_OFFSET ((UINTN) 0x000)
+#define PL061_GPIO_DATA_REG 0x000
+#define PL061_GPIO_DIR_REG 0x400
+#define PL061_GPIO_IS_REG 0x404
+#define PL061_GPIO_IBE_REG 0x408
+#define PL061_GPIO_IEV_REG 0x40C
+#define PL061_GPIO_IE_REG 0x410
+#define PL061_GPIO_RIS_REG 0x414
+#define PL061_GPIO_MIS_REG 0x410
+#define PL061_GPIO_IC_REG 0x41C
+#define PL061_GPIO_AFSEL_REG 0x420
+
+#define PL061_GPIO_PERIPH_ID0 0xFE0
+#define PL061_GPIO_PERIPH_ID1 0xFE4
+#define PL061_GPIO_PERIPH_ID2 0xFE8
+#define PL061_GPIO_PERIPH_ID3 0xFEC
+
+#define PL061_GPIO_PCELL_ID0 0xFF0
+#define PL061_GPIO_PCELL_ID1 0xFF4
+#define PL061_GPIO_PCELL_ID2 0xFF8
+#define PL061_GPIO_PCELL_ID3 0xFFC
+
+#define PL061_GPIO_PINS 8
+
+// All bits low except one bit high, native bit length
+#define GPIO_PIN_MASK(Pin) (1UL << ((UINTN)(Pin)))
+
+#endif // __PL061_GPIO_H__