Skip to content

Commit

Permalink
Add supoort for hpm6360evk
Browse files Browse the repository at this point in the history
  • Loading branch information
freakishness committed Feb 18, 2024
1 parent d3d0373 commit 75f8039
Show file tree
Hide file tree
Showing 58 changed files with 9,683 additions and 0 deletions.
15 changes: 15 additions & 0 deletions arch/risc-v/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,17 @@ config ARCH_CHIP_QEMU_RV
---help---
QEMU Generic RV32/RV64 processor

config ARCH_CHIP_HPM6000
bool "Hpmicro HPM6000"
select ARCH_RV32
select ARCH_RV_ISA_M
select ARCH_RV_ISA_A
select ARCH_RV_ISA_C
select ONESHOT
select ALARM_ARCH
---help---
Hpmicro HPM6000 processor (D45 RISC-V Core with MAC extensions).

config ARCH_CHIP_HPM6750
bool "Hpmicro HPM6750"
select ARCH_RV32
Expand Down Expand Up @@ -399,6 +410,7 @@ config ARCH_CHIP
default "mpfs" if ARCH_CHIP_MPFS
default "rv32m1" if ARCH_CHIP_RV32M1
default "qemu-rv" if ARCH_CHIP_QEMU_RV
default "hpm6000" if ARCH_CHIP_HPM6000
default "hpm6750" if ARCH_CHIP_HPM6750
default "jh7110" if ARCH_CHIP_JH7110
default "bl808" if ARCH_CHIP_BL808
Expand Down Expand Up @@ -566,6 +578,9 @@ endif
if ARCH_CHIP_QEMU_RV
source "arch/risc-v/src/qemu-rv/Kconfig"
endif
if ARCH_CHIP_HPM6000
source "arch/risc-v/src/hpm6000/Kconfig"
endif
if ARCH_CHIP_HPM6750
source "arch/risc-v/src/hpm6750/Kconfig"
endif
Expand Down
24 changes: 24 additions & 0 deletions arch/risc-v/include/hpm6000/chip.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/****************************************************************************
* arch/risc-v/include/hpm6000/chip.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you 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.
*
****************************************************************************/

#ifndef __ARCH_RISCV_INCLUDE_HPM6000_CHIP_H
#define __ARCH_RISCV_INCLUDE_HPM6000_CHIP_H

#endif /* __ARCH_RISCV_INCLUDE_HPM6000_CHIP_H */
119 changes: 119 additions & 0 deletions arch/risc-v/include/hpm6000/hpm_irq.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
/****************************************************************************
* arch/risc-v/include/hpm6000/hpm_irq.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you 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.
*
****************************************************************************/

#ifndef __ARCH_RISCV_INCLUDE_HPM6000_HPM_IRQ_H
#define __ARCH_RISCV_INCLUDE_HPM6000_HPM_IRQ_H

/****************************************************************************
* Included Files
****************************************************************************/

/****************************************************************************
* Pre-processor Prototypes
****************************************************************************/

/* Map RISC-V exception code to NuttX IRQ */

#define HPM_IRQ_PERI_START (RISCV_IRQ_ASYNC + 20)

/* Machine Global External Interrupt */

#define HPM_IRQ_GPIO0_A (HPM_IRQ_PERI_START + 1)
#define HPM_IRQ_GPIO0_B (HPM_IRQ_PERI_START + 2)
#define HPM_IRQ_GPIO0_C (HPM_IRQ_PERI_START + 3)
#define HPM_IRQ_GPIO0_D (HPM_IRQ_PERI_START + 4)
#define HPM_IRQ_GPIO0_X (HPM_IRQ_PERI_START + 5)
#define HPM_IRQ_GPIO0_Y (HPM_IRQ_PERI_START + 6)
#define HPM_IRQ_GPIO0_Z (HPM_IRQ_PERI_START + 7)
#define HPM_IRQ_ADC0 (HPM_IRQ_PERI_START + 8)
#define HPM_IRQ_ADC1 (HPM_IRQ_PERI_START + 9)
#define HPM_IRQ_ADC2 (HPM_IRQ_PERI_START + 10)
#define HPM_IRQ_DAC (HPM_IRQ_PERI_START + 11)
#define HPM_IRQ_ACMP0 (HPM_IRQ_PERI_START + 12)
#define HPM_IRQ_ACMP1 (HPM_IRQ_PERI_START + 13)
#define HPM_IRQ_SPI0 (HPM_IRQ_PERI_START + 14)
#define HPM_IRQ_SPI1 (HPM_IRQ_PERI_START + 15)
#define HPM_IRQ_SPI2 (HPM_IRQ_PERI_START + 16)
#define HPM_IRQ_SPI3 (HPM_IRQ_PERI_START + 17)
#define HPM_IRQ_UART0 (HPM_IRQ_PERI_START + 18)
#define HPM_IRQ_UART1 (HPM_IRQ_PERI_START + 19)
#define HPM_IRQ_UART2 (HPM_IRQ_PERI_START + 20)
#define HPM_IRQ_UART3 (HPM_IRQ_PERI_START + 21)
#define HPM_IRQ_UART4 (HPM_IRQ_PERI_START + 22)
#define HPM_IRQ_UART5 (HPM_IRQ_PERI_START + 23)
#define HPM_IRQ_UART6 (HPM_IRQ_PERI_START + 24)
#define HPM_IRQ_UART7 (HPM_IRQ_PERI_START + 25)
#define HPM_IRQ_CAN0 (HPM_IRQ_PERI_START + 26)
#define HPM_IRQ_CAN1 (HPM_IRQ_PERI_START + 27)
#define HPM_IRQ_PTPC (HPM_IRQ_PERI_START + 28)
#define HPM_IRQ_WDG0 (HPM_IRQ_PERI_START + 29)
#define HPM_IRQ_WDG1 (HPM_IRQ_PERI_START + 30)
#define HPM_IRQ_TSNS (HPM_IRQ_PERI_START + 31)
#define HPM_IRQ_MBX0A (HPM_IRQ_PERI_START + 32)
#define HPM_IRQ_MBX0B (HPM_IRQ_PERI_START + 33)
#define HPM_IRQ_GPTMR0 (HPM_IRQ_PERI_START + 34)
#define HPM_IRQ_GPTMR1 (HPM_IRQ_PERI_START + 35)
#define HPM_IRQ_GPTMR2 (HPM_IRQ_PERI_START + 36)
#define HPM_IRQ_GPTMR3 (HPM_IRQ_PERI_START + 37)
#define HPM_IRQ_I2C0 (HPM_IRQ_PERI_START + 38)
#define HPM_IRQ_I2C1 (HPM_IRQ_PERI_START + 39)
#define HPM_IRQ_I2C2 (HPM_IRQ_PERI_START + 40)
#define HPM_IRQ_I2C3 (HPM_IRQ_PERI_START + 41)
#define HPM_IRQ_PWM0 (HPM_IRQ_PERI_START + 42)
#define HPM_IRQ_HALL0 (HPM_IRQ_PERI_START + 43)
#define HPM_IRQ_QEI0 (HPM_IRQ_PERI_START + 44)
#define HPM_IRQ_PWM1 (HPM_IRQ_PERI_START + 45)
#define HPM_IRQ_HALL1 (HPM_IRQ_PERI_START + 46)
#define HPM_IRQ_QEI1 (HPM_IRQ_PERI_START + 47)
#define HPM_IRQ_SDP (HPM_IRQ_PERI_START + 48)
#define HPM_IRQ_XPI0 (HPM_IRQ_PERI_START + 49)
#define HPM_IRQ_XPI1 (HPM_IRQ_PERI_START + 50)
#define HPM_IRQ_XDMA (HPM_IRQ_PERI_START + 51)
#define HPM_IRQ_HDMA (HPM_IRQ_PERI_START + 52)
#define HPM_IRQ_FEMC (HPM_IRQ_PERI_START + 53)
#define HPM_IRQ_RNG (HPM_IRQ_PERI_START + 54)
#define HPM_IRQ_I2S0 (HPM_IRQ_PERI_START + 55)
#define HPM_IRQ_I2S1 (HPM_IRQ_PERI_START + 56)
#define HPM_IRQ_DAO (HPM_IRQ_PERI_START + 57)
#define HPM_IRQ_PDM (HPM_IRQ_PERI_START + 58)
#define HPM_IRQ_EFA (HPM_IRQ_PERI_START + 59)
#define HPM_IRQ_NTMR0 (HPM_IRQ_PERI_START + 60)
#define HPM_IRQ_USB0 (HPM_IRQ_PERI_START + 61)
#define HPM_IRQ_ENET0 (HPM_IRQ_PERI_START + 62)
#define HPM_IRQ_SDXC0 (HPM_IRQ_PERI_START + 63)
#define HPM_IRQ_PSEC (HPM_IRQ_PERI_START + 64)
#define HPM_IRQ_PGPIO (HPM_IRQ_PERI_START + 65)
#define HPM_IRQ_PWDG (HPM_IRQ_PERI_START + 66)
#define HPM_IRQ_PTMR (HPM_IRQ_PERI_START + 67)
#define HPM_IRQ_PUART (HPM_IRQ_PERI_START + 68)
#define HPM_IRQ_FUSE (HPM_IRQ_PERI_START + 69)
#define HPM_IRQ_SECMON (HPM_IRQ_PERI_START + 70)
#define HPM_IRQ_RTC (HPM_IRQ_PERI_START + 71)
#define HPM_IRQ_BUTN (HPM_IRQ_PERI_START + 72)
#define HPM_IRQ_BGPIO (HPM_IRQ_PERI_START + 73)
#define HPM_IRQ_BVIO (HPM_IRQ_PERI_START + 74)
#define HPM_IRQ_BROWNOUT (HPM_IRQ_PERI_START + 75)
#define HPM_IRQ_SYSCTL (HPM_IRQ_PERI_START + 76)

/* Total number of IRQs */

#define NR_IRQS (HPM_IRQ_PERI_START + 76)

#endif /* __ARCH_RISCV_INCLUDE_HPM6000_HPM_IRQ_H */
34 changes: 34 additions & 0 deletions arch/risc-v/include/hpm6000/irq.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/****************************************************************************
* arch/risc-v/include/hpm6000/irq.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you 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.
*
****************************************************************************/

#ifndef __ARCH_RISCV_INCLUDE_HPM6000_IRQ_H
#define __ARCH_RISCV_INCLUDE_HPM6000_IRQ_H

/****************************************************************************
* Included Files
****************************************************************************/

#include "hpm_irq.h"

/****************************************************************************
* Pre-processor Definitions
****************************************************************************/

#endif /* __ARCH_RISCV_INCLUDE_HPM6000_IRQ_H */
37 changes: 37 additions & 0 deletions arch/risc-v/src/hpm6000/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# ##############################################################################
# arch/arm/src/qemu-rv/CMakeLists.txt
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you 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.
#
# ##############################################################################

set(SRCS hpm_head.S)

list(
APPEND
SRCS
hpm_clockconfig.c
hpm_gpio.c
hpm_ioc.c
hpm_irq.c
hpm_irq_dispatch.c
hpm_lowputc.c
hpm_serial.c
hpm_start.c
hpm_timerisr.c
)

target_sources(arch PRIVATE ${SRCS})
116 changes: 116 additions & 0 deletions arch/risc-v/src/hpm6000/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#

comment "HPM6000 Configuration Options"

choice
prompt "HPM6000 Chip Selection"
default ARCH_CHIP_HPM6360IPA
depends on ARCH_CHIP_HPM6000

config ARCH_CHIP_HPM6360IPA
bool "HPM6360IPA"
select ARCH_FAMILY_HPM6360

endchoice # HPM6000 Chip Selection

# HPM6000 Families

config ARCH_FAMILY_HPM6360
bool
default n
select ARCH_FAMILY_HPM6300

# Peripheral support

menu "HPM6000 Peripheral Selection"

config HPM_ENET
bool "Ethernet"
default n

menu "Watchdog"

config HPM_WDOG0
bool "WathDog"
default n

config HPM_WDOG1
bool "WathDog"
default n

config HPM_WDOG2
bool "WathDog"
default n

endmenu # Watchdog

menu "UART Peripherals"

config HPM_UART0
bool "UART0"
default n
select UART0_SERIALDRIVER
select ARCH_HAVE_SERIAL_TERMIOS
select HPM_HAVE_UART

config HPM_UART1
bool "UART1"
default n
select UART1_SERIALDRIVER
select ARCH_HAVE_SERIAL_TERMIOS
select HPM_HAVE_UART

config HPM_UART2
bool "UART2"
default n
select UART2_SERIALDRIVER
select ARCH_HAVE_SERIAL_TERMIOS
select HPM_HAVE_UART

config HPM_UART3
bool "UART3"
default n
select UART3_SERIALDRIVER
select ARCH_HAVE_SERIAL_TERMIOS
select HPM_HAVE_UART

config HPM_UART4
bool "UART4"
default n
select UART4_SERIALDRIVER
select ARCH_HAVE_SERIAL_TERMIOS
select HPM_HAVE_UART

config HPM_UART5
bool "UART5"
default n
select UART5_SERIALDRIVER
select ARCH_HAVE_SERIAL_TERMIOS
select HPM_HAVE_UART

config HPM_UART6
bool "UART6"
default n
select UART6_SERIALDRIVER
select ARCH_HAVE_SERIAL_TERMIOS
select HPM_HAVE_UART

config HPM_UART7
bool "UART7"
default n
select UART7_SERIALDRIVER
select ARCH_HAVE_SERIAL_TERMIOS
select HPM_HAVE_UART

config HPM_PUART
bool "PUART"
default n
select PUART_SERIALDRIVER
select ARCH_HAVE_SERIAL_TERMIOS
select HPM_HAVE_UART

endmenu # UART Peripherals
endmenu # HPM6000 Peripheral Selection
Loading

0 comments on commit 75f8039

Please sign in to comment.