Skip to content

Commit d082af3

Browse files
chenzhihong007xiaoxiang781216
authored andcommitted
add hpmicro chip: hpm6750
Signed-off-by: Zhihong Chen <[email protected]>
1 parent 4aada75 commit d082af3

40 files changed

+6093
-0
lines changed

arch/risc-v/Kconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,17 @@ config ARCH_CHIP_QEMU_RV
146146
---help---
147147
QEMU Generic RV32/RV64 processor
148148

149+
config ARCH_CHIP_HPM6750
150+
bool "Hpmicro HPM6750"
151+
select ARCH_RV32
152+
select ARCH_RV_ISA_M
153+
select ARCH_RV_ISA_A
154+
select ARCH_RV_ISA_C
155+
select ONESHOT
156+
select ALARM_ARCH
157+
---help---
158+
Hpmicro HPM6750 processor (D45 RISC-V Core with MAC extensions).
159+
149160
config ARCH_CHIP_RISCV_CUSTOM
150161
bool "Custom RISC-V chip"
151162
select ARCH_CHIP_CUSTOM
@@ -192,6 +203,7 @@ config ARCH_CHIP
192203
default "mpfs" if ARCH_CHIP_MPFS
193204
default "rv32m1" if ARCH_CHIP_RV32M1
194205
default "qemu-rv" if ARCH_CHIP_QEMU_RV
206+
default "hpm6750" if ARCH_CHIP_HPM6750
195207

196208
config ARCH_RISCV_INTXCPT_EXTENSIONS
197209
bool "RISC-V Integer Context Extensions"
@@ -329,4 +341,7 @@ endif
329341
if ARCH_CHIP_QEMU_RV
330342
source "arch/risc-v/src/qemu-rv/Kconfig"
331343
endif
344+
if ARCH_CHIP_HPM6750
345+
source "arch/risc-v/src/hpm6750/Kconfig"
346+
endif
332347
endif

arch/risc-v/include/hpm6750/chip.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/****************************************************************************
2+
* arch/risc-v/include/hpm6750/chip.h
3+
*
4+
* Licensed to the Apache Software Foundation (ASF) under one or more
5+
* contributor license agreements. See the NOTICE file distributed with
6+
* this work for additional information regarding copyright ownership. The
7+
* ASF licenses this file to you under the Apache License, Version 2.0 (the
8+
* "License"); you may not use this file except in compliance with the
9+
* License. You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16+
* License for the specific language governing permissions and limitations
17+
* under the License.
18+
*
19+
****************************************************************************/
20+
21+
#ifndef __ARCH_RISCV_INCLUDE_HPM6750_CHIP_H
22+
#define __ARCH_RISCV_INCLUDE_HPM6750_CHIP_H
23+
24+
#endif /* __ARCH_RISCV_INCLUDE_HPM6750_CHIP_H */

arch/risc-v/include/hpm6750/irq.h

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
/****************************************************************************
2+
* arch/risc-v/include/hpm6750/irq.h
3+
*
4+
* Licensed to the Apache Software Foundation (ASF) under one or more
5+
* contributor license agreements. See the NOTICE file distributed with
6+
* this work for additional information regarding copyright ownership. The
7+
* ASF licenses this file to you under the Apache License, Version 2.0 (the
8+
* "License"); you may not use this file except in compliance with the
9+
* License. You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16+
* License for the specific language governing permissions and limitations
17+
* under the License.
18+
*
19+
****************************************************************************/
20+
21+
#ifndef __ARCH_RISCV_INCLUDE_HPM6750_IRQ_H
22+
#define __ARCH_RISCV_INCLUDE_HPM6750_IRQ_H
23+
24+
/****************************************************************************
25+
* Included Files
26+
****************************************************************************/
27+
28+
/****************************************************************************
29+
* Pre-processor Definitions
30+
****************************************************************************/
31+
32+
/* Map RISC-V exception code to NuttX IRQ */
33+
34+
#define HPM6750_IRQ_PERI_START (RISCV_IRQ_ASYNC + 20)
35+
36+
/* Machine Global External Interrupt */
37+
38+
#define HPM6750_IRQ_GPIO0_A (HPM6750_IRQ_PERI_START + 1)
39+
#define HPM6750_IRQ_GPIO0_B (HPM6750_IRQ_PERI_START + 2)
40+
#define HPM6750_IRQ_GPIO0_C (HPM6750_IRQ_PERI_START + 3)
41+
#define HPM6750_IRQ_GPIO0_D (HPM6750_IRQ_PERI_START + 4)
42+
#define HPM6750_IRQ_GPIO0_E (HPM6750_IRQ_PERI_START + 5)
43+
#define HPM6750_IRQ_GPIO0_F (HPM6750_IRQ_PERI_START + 6)
44+
#define HPM6750_IRQ_GPIO0_X (HPM6750_IRQ_PERI_START + 7)
45+
#define HPM6750_IRQ_GPIO0_Y (HPM6750_IRQ_PERI_START + 8)
46+
#define HPM6750_IRQ_GPIO0_Z (HPM6750_IRQ_PERI_START + 9)
47+
#define HPM6750_IRQ_GPIO1_A (HPM6750_IRQ_PERI_START + 10)
48+
#define HPM6750_IRQ_GPIO1_B (HPM6750_IRQ_PERI_START + 11)
49+
#define HPM6750_IRQ_GPIO1_C (HPM6750_IRQ_PERI_START + 12)
50+
#define HPM6750_IRQ_GPIO1_D (HPM6750_IRQ_PERI_START + 13)
51+
#define HPM6750_IRQ_GPIO1_E (HPM6750_IRQ_PERI_START + 14)
52+
#define HPM6750_IRQ_GPIO1_F (HPM6750_IRQ_PERI_START + 15)
53+
#define HPM6750_IRQ_GPIO1_X (HPM6750_IRQ_PERI_START + 16)
54+
#define HPM6750_IRQ_GPIO1_Y (HPM6750_IRQ_PERI_START + 17)
55+
#define HPM6750_IRQ_GPIO1_Z (HPM6750_IRQ_PERI_START + 18)
56+
#define HPM6750_IRQ_ADC0 (HPM6750_IRQ_PERI_START + 19)
57+
#define HPM6750_IRQ_ADC1 (HPM6750_IRQ_PERI_START + 20)
58+
#define HPM6750_IRQ_ADC2 (HPM6750_IRQ_PERI_START + 21)
59+
#define HPM6750_IRQ_ADC3 (HPM6750_IRQ_PERI_START + 22)
60+
#define HPM6750_IRQ_ACMP_0 (HPM6750_IRQ_PERI_START + 23)
61+
#define HPM6750_IRQ_ACMP_1 (HPM6750_IRQ_PERI_START + 24)
62+
#define HPM6750_IRQ_ACMP_2 (HPM6750_IRQ_PERI_START + 25)
63+
#define HPM6750_IRQ_ACMP_3 (HPM6750_IRQ_PERI_START + 26)
64+
#define HPM6750_IRQ_SPI0 (HPM6750_IRQ_PERI_START + 27)
65+
#define HPM6750_IRQ_SPI1 (HPM6750_IRQ_PERI_START + 28)
66+
#define HPM6750_IRQ_SPI2 (HPM6750_IRQ_PERI_START + 29)
67+
#define HPM6750_IRQ_SPI3 (HPM6750_IRQ_PERI_START + 30)
68+
#define HPM6750_IRQ_UART0 (HPM6750_IRQ_PERI_START + 31)
69+
#define HPM6750_IRQ_UART1 (HPM6750_IRQ_PERI_START + 32)
70+
#define HPM6750_IRQ_UART2 (HPM6750_IRQ_PERI_START + 33)
71+
#define HPM6750_IRQ_UART3 (HPM6750_IRQ_PERI_START + 34)
72+
#define HPM6750_IRQ_UART4 (HPM6750_IRQ_PERI_START + 35)
73+
#define HPM6750_IRQ_UART5 (HPM6750_IRQ_PERI_START + 36)
74+
#define HPM6750_IRQ_UART6 (HPM6750_IRQ_PERI_START + 37)
75+
#define HPM6750_IRQ_UART7 (HPM6750_IRQ_PERI_START + 38)
76+
#define HPM6750_IRQ_UART8 (HPM6750_IRQ_PERI_START + 39)
77+
#define HPM6750_IRQ_UART9 (HPM6750_IRQ_PERI_START + 40)
78+
#define HPM6750_IRQ_UART10 (HPM6750_IRQ_PERI_START + 41)
79+
#define HPM6750_IRQ_UART11 (HPM6750_IRQ_PERI_START + 42)
80+
#define HPM6750_IRQ_UART12 (HPM6750_IRQ_PERI_START + 43)
81+
#define HPM6750_IRQ_UART13 (HPM6750_IRQ_PERI_START + 44)
82+
#define HPM6750_IRQ_UART14 (HPM6750_IRQ_PERI_START + 45)
83+
#define HPM6750_IRQ_UART15 (HPM6750_IRQ_PERI_START + 46)
84+
#define HPM6750_IRQ_CAN0 (HPM6750_IRQ_PERI_START + 47)
85+
#define HPM6750_IRQ_CAN1 (HPM6750_IRQ_PERI_START + 48)
86+
#define HPM6750_IRQ_CAN2 (HPM6750_IRQ_PERI_START + 49)
87+
#define HPM6750_IRQ_CAN3 (HPM6750_IRQ_PERI_START + 50)
88+
#define HPM6750_IRQ_PTPC (HPM6750_IRQ_PERI_START + 51)
89+
#define HPM6750_IRQ_WDG0 (HPM6750_IRQ_PERI_START + 52)
90+
#define HPM6750_IRQ_WDG1 (HPM6750_IRQ_PERI_START + 53)
91+
#define HPM6750_IRQ_WDG2 (HPM6750_IRQ_PERI_START + 54)
92+
#define HPM6750_IRQ_WDG3 (HPM6750_IRQ_PERI_START + 55)
93+
#define HPM6750_IRQ_MBX0A (HPM6750_IRQ_PERI_START + 56)
94+
#define HPM6750_IRQ_MBX0B (HPM6750_IRQ_PERI_START + 57)
95+
#define HPM6750_IRQ_MBX1A (HPM6750_IRQ_PERI_START + 58)
96+
#define HPM6750_IRQ_MBX1B (HPM6750_IRQ_PERI_START + 59)
97+
#define HPM6750_IRQ_GPTMR0 (HPM6750_IRQ_PERI_START + 60)
98+
#define HPM6750_IRQ_GPTMR1 (HPM6750_IRQ_PERI_START + 61)
99+
#define HPM6750_IRQ_GPTMR2 (HPM6750_IRQ_PERI_START + 62)
100+
#define HPM6750_IRQ_GPTMR3 (HPM6750_IRQ_PERI_START + 63)
101+
#define HPM6750_IRQ_GPTMR4 (HPM6750_IRQ_PERI_START + 64)
102+
#define HPM6750_IRQ_GPTMR5 (HPM6750_IRQ_PERI_START + 65)
103+
#define HPM6750_IRQ_GPTMR6 (HPM6750_IRQ_PERI_START + 66)
104+
#define HPM6750_IRQ_GPTMR7 (HPM6750_IRQ_PERI_START + 67)
105+
#define HPM6750_IRQ_I2C0 (HPM6750_IRQ_PERI_START + 68)
106+
#define HPM6750_IRQ_I2C1 (HPM6750_IRQ_PERI_START + 69)
107+
#define HPM6750_IRQ_I2C2 (HPM6750_IRQ_PERI_START + 70)
108+
#define HPM6750_IRQ_I2C3 (HPM6750_IRQ_PERI_START + 71)
109+
#define HPM6750_IRQ_PWM0 (HPM6750_IRQ_PERI_START + 72)
110+
#define HPM6750_IRQ_HALL0 (HPM6750_IRQ_PERI_START + 73)
111+
#define HPM6750_IRQ_QEI0 (HPM6750_IRQ_PERI_START + 74)
112+
#define HPM6750_IRQ_PWM1 (HPM6750_IRQ_PERI_START + 75)
113+
#define HPM6750_IRQ_HALL1 (HPM6750_IRQ_PERI_START + 76)
114+
#define HPM6750_IRQ_QEI1 (HPM6750_IRQ_PERI_START + 77)
115+
#define HPM6750_IRQ_PWM2 (HPM6750_IRQ_PERI_START + 78)
116+
#define HPM6750_IRQ_HALL2 (HPM6750_IRQ_PERI_START + 79)
117+
#define HPM6750_IRQ_QEI2 (HPM6750_IRQ_PERI_START + 80)
118+
#define HPM6750_IRQ_PWM3 (HPM6750_IRQ_PERI_START + 81)
119+
#define HPM6750_IRQ_HALL3 (HPM6750_IRQ_PERI_START + 82)
120+
#define HPM6750_IRQ_QEI3 (HPM6750_IRQ_PERI_START + 83)
121+
#define HPM6750_IRQ_SDP (HPM6750_IRQ_PERI_START + 84)
122+
#define HPM6750_IRQ_XPI0 (HPM6750_IRQ_PERI_START + 85)
123+
#define HPM6750_IRQ_XPI1 (HPM6750_IRQ_PERI_START + 86)
124+
#define HPM6750_IRQ_XDMA (HPM6750_IRQ_PERI_START + 87)
125+
#define HPM6750_IRQ_HDMA (HPM6750_IRQ_PERI_START + 88)
126+
#define HPM6750_IRQ_FEMC (HPM6750_IRQ_PERI_START + 89)
127+
#define HPM6750_IRQ_RNG (HPM6750_IRQ_PERI_START + 90)
128+
#define HPM6750_IRQ_I2S0 (HPM6750_IRQ_PERI_START + 91)
129+
#define HPM6750_IRQ_I2S1 (HPM6750_IRQ_PERI_START + 92)
130+
#define HPM6750_IRQ_I2S2 (HPM6750_IRQ_PERI_START + 93)
131+
#define HPM6750_IRQ_I2S3 (HPM6750_IRQ_PERI_START + 94)
132+
#define HPM6750_IRQ_DAO (HPM6750_IRQ_PERI_START + 95)
133+
#define HPM6750_IRQ_PDM (HPM6750_IRQ_PERI_START + 96)
134+
#define HPM6750_IRQ_CAM0 (HPM6750_IRQ_PERI_START + 97)
135+
#define HPM6750_IRQ_CAM1 (HPM6750_IRQ_PERI_START + 98)
136+
#define HPM6750_IRQ_LCDC_D0 (HPM6750_IRQ_PERI_START + 99)
137+
#define HPM6750_IRQ_LCDC_D1 (HPM6750_IRQ_PERI_START + 100)
138+
#define HPM6750_IRQ_PDMA_D0 (HPM6750_IRQ_PERI_START + 101)
139+
#define HPM6750_IRQ_PDMA_D1 (HPM6750_IRQ_PERI_START + 102)
140+
#define HPM6750_IRQ_JPEG (HPM6750_IRQ_PERI_START + 103)
141+
#define HPM6750_IRQ_NTMR0 (HPM6750_IRQ_PERI_START + 104)
142+
#define HPM6750_IRQ_NTMR1 (HPM6750_IRQ_PERI_START + 105)
143+
#define HPM6750_IRQ_USB0 (HPM6750_IRQ_PERI_START + 106)
144+
#define HPM6750_IRQ_USB1 (HPM6750_IRQ_PERI_START + 107)
145+
#define HPM6750_IRQ_ENET0 (HPM6750_IRQ_PERI_START + 108)
146+
#define HPM6750_IRQ_ENET1 (HPM6750_IRQ_PERI_START + 109)
147+
#define HPM6750_IRQ_SDXC0 (HPM6750_IRQ_PERI_START + 110)
148+
#define HPM6750_IRQ_SDXC1 (HPM6750_IRQ_PERI_START + 111)
149+
#define HPM6750_IRQ_PSEC (HPM6750_IRQ_PERI_START + 112)
150+
#define HPM6750_IRQ_PGPIO (HPM6750_IRQ_PERI_START + 113)
151+
#define HPM6750_IRQ_PWDG (HPM6750_IRQ_PERI_START + 114)
152+
#define HPM6750_IRQ_PTMR (HPM6750_IRQ_PERI_START + 115)
153+
#define HPM6750_IRQ_PUART (HPM6750_IRQ_PERI_START + 116)
154+
#define HPM6750_IRQ_VAD (HPM6750_IRQ_PERI_START + 117)
155+
#define HPM6750_IRQ_FUSE (HPM6750_IRQ_PERI_START + 118)
156+
#define HPM6750_IRQ_SECMON (HPM6750_IRQ_PERI_START + 119)
157+
#define HPM6750_IRQ_RTC (HPM6750_IRQ_PERI_START + 120)
158+
#define HPM6750_IRQ_BUTN (HPM6750_IRQ_PERI_START + 121)
159+
#define HPM6750_IRQ_BGPIO (HPM6750_IRQ_PERI_START + 122)
160+
#define HPM6750_IRQ_BVIO (HPM6750_IRQ_PERI_START + 123)
161+
#define HPM6750_IRQ_BROWNOUT (HPM6750_IRQ_PERI_START + 124)
162+
#define HPM6750_IRQ_SYSCTL (HPM6750_IRQ_PERI_START + 125)
163+
#define HPM6750_IRQ_DEBUG_0 (HPM6750_IRQ_PERI_START + 126)
164+
#define HPM6750_IRQ_DEBUG_1 (HPM6750_IRQ_PERI_START + 127)
165+
166+
/* Total number of IRQs */
167+
168+
#define NR_IRQS (HPM6750_IRQ_PERI_START + 127)
169+
170+
#endif /* __ARCH_RISCV_INCLUDE_HPM6750_IRQ_H */

arch/risc-v/src/hpm6750/Kconfig

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#
2+
# For a description of the syntax of this configuration file,
3+
# see the file kconfig-language.txt in the NuttX tools repository.
4+
#
5+
6+
comment "HPM6750 Configuration Options"
7+
8+
menu "HPM6750 Peripheral Support"
9+
10+
# These "hidden" settings determine whether a peripheral option is available
11+
# for the selected MCU
12+
13+
config HPM6750_HAVE_UART0
14+
bool
15+
default y
16+
select UART0_SERIALDRIVER
17+
select ARCH_HAVE_SERIAL_TERMIOS
18+
19+
# These are the peripheral selections proper
20+
21+
config HPM6750_UART0
22+
bool "UART0"
23+
default y
24+
select ARCH_HAVE_UART0
25+
select ARCH_HAVE_SERIAL_TERMIOS
26+
select HPM6750_UART
27+
28+
endmenu

arch/risc-v/src/hpm6750/Make.defs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
############################################################################
2+
# arch/risc-v/src/hpm6750/Make.defs
3+
#
4+
# Licensed to the Apache Software Foundation (ASF) under one or more
5+
# contributor license agreements. See the NOTICE file distributed with
6+
# this work for additional information regarding copyright ownership. The
7+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance with the
9+
# License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16+
# License for the specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
############################################################################
20+
21+
include common/Make.defs
22+
23+
# Specify our HEAD assembly file. This will be linked as
24+
# the first object file, so it will appear at address 0
25+
HEAD_ASRC = hpm6750_head.S
26+
27+
# Specify our C code within this directory to be included
28+
CHIP_CSRCS = hpm6750_clockconfig.c
29+
CHIP_CSRCS += hpm6750_irq.c hpm6750_irq_dispatch.c
30+
CHIP_CSRCS += hpm6750_lowputc.c hpm6750_serial.c
31+
CHIP_CSRCS += hpm6750_start.c hpm6750_timerisr.c

arch/risc-v/src/hpm6750/chip.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/****************************************************************************
2+
* arch/risc-v/src/hpm6750/chip.h
3+
*
4+
* Licensed to the Apache Software Foundation (ASF) under one or more
5+
* contributor license agreements. See the NOTICE file distributed with
6+
* this work for additional information regarding copyright ownership. The
7+
* ASF licenses this file to you under the Apache License, Version 2.0 (the
8+
* "License"); you may not use this file except in compliance with the
9+
* License. You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16+
* License for the specific language governing permissions and limitations
17+
* under the License.
18+
*
19+
****************************************************************************/
20+
21+
#ifndef __ARCH_RISCV_SRC_HPM6750_CHIP_H
22+
#define __ARCH_RISCV_SRC_HPM6750_CHIP_H
23+
24+
/****************************************************************************
25+
* Included Files
26+
****************************************************************************/
27+
28+
#include <nuttx/config.h>
29+
30+
#include "hpm6750_memorymap.h"
31+
32+
#endif /* __ARCH_RISCV_SRC_HPM6750_CHIP_H */

0 commit comments

Comments
 (0)