From 00a91730cf7eca0da16751bbd9d6dc76eb30f414 Mon Sep 17 00:00:00 2001 From: Akila N Date: Wed, 16 Mar 2016 15:45:17 +0530 Subject: [PATCH] qca: ipq40xx: Adding files iomap.h and gpio.h Change-Id: I3b7d64f5172d9e52626f4e24c8a6f2b386201df0 Signed-off-by: Akila N --- arch/arm/include/asm/arch-ipq40xx/iomap.h | 30 ++++++++ arch/arm/include/asm/arch-qcom-common/gpio.h | 79 ++++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 arch/arm/include/asm/arch-ipq40xx/iomap.h create mode 100644 arch/arm/include/asm/arch-qcom-common/gpio.h diff --git a/arch/arm/include/asm/arch-ipq40xx/iomap.h b/arch/arm/include/asm/arch-ipq40xx/iomap.h new file mode 100644 index 0000000000..3df563ec0a --- /dev/null +++ b/arch/arm/include/asm/arch-ipq40xx/iomap.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2015, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * 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. + */ + +#ifndef _PLATFORM_IPQ40XX_IOMAP_H_ +#define _PLATFORM_IPQ40XX_IOMAP_H_ + +#include +#define CLK_CTL_BASE 0x01800000 +#define GCNT_BASE 0x004a1000 +#define TIMER_BASE 0x0B021000 +#define UART2_DM_BASE 0x078b0000 +#define UART1_DM_BASE 0x078af000 +#define I2C0_BASE 0x078B7000 +#define TLMM_BASE 0x01000000 +#define GPIO_CONFIG_ADDR(x) (TLMM_BASE + (x)*0x1000) +#define GPIO_IN_OUT_ADDR(x) (TLMM_BASE + 0x4 + (x)*0x1000) + +#define GCNT_PSHOLD 0x004AB000 + +#endif /* _PLATFORM_IPQ40XX_IOMAP_H_ */ diff --git a/arch/arm/include/asm/arch-qcom-common/gpio.h b/arch/arm/include/asm/arch-qcom-common/gpio.h new file mode 100644 index 0000000000..bf521a33d6 --- /dev/null +++ b/arch/arm/include/asm/arch-qcom-common/gpio.h @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2011-2012, 2016, The Linux Foundation. All rights reserved. + * Source : APQ8064 LK Boot + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Code Aurora Forum, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef GPIO_H +#define GPIO_H + +/* GPIO TLMM: Direction */ +#define GPIO_INPUT 0 +#define GPIO_OUTPUT 1 + +/* GPIO TLMM: Output value */ +#define GPIO_OUT_LOW 0 +#define GPIO_OUT_HIGH 1 + +/* GPIO TLMM: Pullup/Pulldown */ +#define GPIO_NO_PULL 0 +#define GPIO_PULL_DOWN 1 +#define GPIO_PULL_UP 2 +#define GPIO_NOT_DEF 3 + +/* GPIO TLMM: Drive Strength */ +#define GPIO_2MA 0 +#define GPIO_4MA 1 +#define GPIO_6MA 2 +#define GPIO_8MA 3 +#define GPIO_10MA 4 +#define GPIO_12MA 5 +#define GPIO_14MA 6 +#define GPIO_16MA 7 + +/* GPIO TLMM: Status */ +#define GPIO_OE_DISABLE 0 +#define GPIO_OE_ENABLE 1 + +/* GPIO VM */ +#define GPIO_VM_ENABLE 1 +#define GPIO_VM_DISABLE 0 + +/* GPIO OD */ +#define GPIO_OD_ENABLE 1 +#define GPIO_OD_DISABLE 0 + +/* GPIO PULLUP RES */ +#define GPIO_PULL_RES0 0 +#define GPIO_PULL_RES1 1 +#define GPIO_PULL_RES2 2 +#define GPIO_PULL_RES3 3 + +#define GPIO_OUT (1 << 1) +#define GPIO_IN (1 << 0) + +#endif