Skip to content

Commit a1c1c90

Browse files
Hazel Zhangeasonxiang
authored andcommitted
update pinmux code
update pinmux code ,separate uwp5661 and uwp5662 into two files. Signed-off-by: Hazel Zhang <hazel.zhang@unisoc.com>
1 parent 437ff7c commit a1c1c90

File tree

11 files changed

+758
-374
lines changed

11 files changed

+758
-374
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ if(CONFIG_HAS_UWP)
1111
zephyr_sources_ifdef(CONFIG_USE_UWP_HAL_GNSS soc/gnss.c)
1212
zephyr_sources_ifdef(CONFIG_USE_UWP_HAL_FW soc/load_fw.c)
1313

14-
zephyr_sources_ifdef(CONFIG_PINMUX_UWP drivers/src/hal_pinmux.c)
14+
zephyr_sources_ifdef(CONFIG_SOC_UWP5661&&CONFIG_PINMUX_UWP drivers/src/hal_pinmux_uwp5661.c)
15+
zephyr_sources_ifdef(CONFIG_SOC_UWP5662&&CONFIG_PINMUX_UWP drivers/src/hal_pinmux_uwp5662.c)
1516
endif()

drivers/include/hal_pin_reg.h renamed to drivers/include/hal_pin_reg_uwp5661.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
#ifndef _HAL_PIN_REG_H
8-
#define _HAL_PIN_REG_H
7+
#ifndef _HAL_PIN_REG_UWP5661_H
8+
#define _HAL_PIN_REG_UWP5661_H
99

1010
#ifdef __cpluscplus
1111
extern "C"
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
/*
2+
* Copyright (c) 2018, UNISOC Incorporated
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#ifndef _HAL_PIN_REG_H
8+
#define _HAL_PIN_REG_H
9+
10+
#ifdef __cpluscplus
11+
extern "C"
12+
{
13+
#endif
14+
15+
#include <sys/types.h>
16+
#include "hal_pinmap.h"
17+
#include <uwp_hal.h>
18+
19+
#define GROUP(x) (x+0x400)
20+
#define CTL_BASE_PIN (BASE_AON_PIN)
21+
22+
#define PIN_PAD_CTRL_RESERVED (CTL_BASE_PIN+0x0000)
23+
#define PIN_PIN_CRTL_REG0 (CTL_BASE_PIN+0x0004)
24+
#define PIN_PIN_CRTL_REG1 (CTL_BASE_PIN+0x0008)
25+
#define PIN_PIN_CRTL_REG2 (CTL_BASE_PIN+0x000C)
26+
#define PIN_PIN_CRTL_REG3 (CTL_BASE_PIN+0x0010)
27+
#define PIN_PIN_CRTL_REG4 (CTL_BASE_PIN+0x0014)
28+
#define PIN_PIN_CRTL_REG5 (CTL_BASE_PIN+0x0018)
29+
30+
#define PIN_GPIO1_REG (CTL_BASE_PIN+0x001C)
31+
#define PIN_GPIO2_REG (CTL_BASE_PIN+0x0020)
32+
#define PIN_GPIO0_REG (CTL_BASE_PIN+0x0024)
33+
#define PIN_GPIO3_REG (CTL_BASE_PIN+0x0028)
34+
35+
#define PIN_RFCTL7_REG (CTL_BASE_PIN+0x002C)
36+
#define PIN_RFCTL6_REG (CTL_BASE_PIN+0x0030)
37+
#define PIN_RFCTL4_REG (CTL_BASE_PIN+0x0034)
38+
#define PIN_RFCTL5_REG (CTL_BASE_PIN+0x0038)
39+
40+
#define PIN_U1TXD_REG (CTL_BASE_PIN+0x003C)
41+
#define PIN_U1RXD_REG (CTL_BASE_PIN+0x0040)
42+
#define PIN_U1RTS_REG (CTL_BASE_PIN+0x0044)
43+
#define PIN_U1CTS_REG (CTL_BASE_PIN+0x0048)
44+
45+
#define PIN_U0TXD_REG (CTL_BASE_PIN+0x004C)
46+
#define PIN_U0RXD_REG (CTL_BASE_PIN+0x0050)
47+
#define PIN_U0RTS_REG (CTL_BASE_PIN+0x0054)
48+
#define PIN_U0CTS_REG (CTL_BASE_PIN+0x0058)
49+
50+
#define PIN_IISDI_REG (CTL_BASE_PIN+0x005C)
51+
#define PIN_IISDO_REG (CTL_BASE_PIN+0x0060)
52+
#define PIN_IISCLK_REG (CTL_BASE_PIN+0x0064)
53+
#define PIN_IISLRCK_REG (CTL_BASE_PIN+0x0068)
54+
55+
#define PIN_U3RXD_REG (CTL_BASE_PIN+0x006C)
56+
#define PIN_U3TXD_REG (CTL_BASE_PIN+0x0070)
57+
58+
#define PIN_RST_N_REG (CTL_BASE_PIN+0x0074)
59+
#define PIN_MTMS_REG (CTL_BASE_PIN+0x0078)
60+
#define PIN_MTCK_REG (CTL_BASE_PIN+0x007C)
61+
#define PIN_CHIP_EN_REG (CTL_BASE_PIN+0x0080)
62+
63+
#define PIN_ESMD3_REG (CTL_BASE_PIN+0x0084)
64+
#define PIN_ESMD2_REG (CTL_BASE_PIN+0x0088)
65+
#define PIN_ESMD1_REG (CTL_BASE_PIN+0x008C)
66+
#define PIN_ESMCSN_REG (CTL_BASE_PIN+0x0090)
67+
#define PIN_ESMD0_REG (CTL_BASE_PIN+0x0094)
68+
#define PIN_ESMSMP_REG (CTL_BASE_PIN+0x0098)
69+
#define PIN_ESMCLK_REG (CTL_BASE_PIN+0x009C)
70+
71+
#define PIN_SD_D3_REG (CTL_BASE_PIN+0x00A0)
72+
#define PIN_SD_D0_REG (CTL_BASE_PIN+0x00A4)
73+
#define PIN_SD_D2_REG (CTL_BASE_PIN+0x00A8)
74+
#define PIN_SD_D1_REG (CTL_BASE_PIN+0x00AC)
75+
#define PIN_SD_CLK_REG (CTL_BASE_PIN+0x00B0)
76+
#define PIN_SD_CMD_REG (CTL_BASE_PIN+0x00B4)
77+
78+
#define PIN_U2RXD_REG (CTL_BASE_PIN+0x00B8)
79+
#define PIN_U2TXD_REG (CTL_BASE_PIN+0x00BC)
80+
81+
#define PIN_PTEST_REG (CTL_BASE_PIN+0x00C0)
82+
#define PIN_WCI_2_TXD_REG (CTL_BASE_PIN+0x00C4)
83+
#define PIN_WCI_2_RXD_REG (CTL_BASE_PIN+0x00C8)
84+
#define PIN_XTLEN_REG (CTL_BASE_PIN+0x00CC)
85+
#define PIN_GNSS_LNA_EN_REG (CTL_BASE_PIN+0x00D0)
86+
#define PIN_INT_REG (CTL_BASE_PIN+0x00D4)
87+
88+
89+
/*pinmap ctrl register Bit field value*/
90+
91+
/*
92+
* |Reserved[31:16] | Drv btr sel[15:14] | bsr wpus[12] | bsr se[11]
93+
* | func PU[8] | func PD[7] |func sel[6:4]
94+
* | PU[3] | PD[2] | input En[1] | output En[0] |
95+
*/
96+
#define PMUX_FPU_EN (1)
97+
#define PMUX_FPD_EN (0)
98+
99+
#define BIT_APB_PIN_EB BIT(18)
100+
#define BIT_18 0x00040000
101+
102+
#ifdef __cpluscplus
103+
}
104+
#endif
105+
106+
#endif /*_PIN_REG_MARLIN3_H*/
107+
/*end*/

0 commit comments

Comments
 (0)