Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,20 @@ config ARCH_CHIP_QEMU_ARM
---help---
QEMU virt platform (ARMv7a)

config ARCH_CHIP_RK3506
bool "Rockchip RK3506 (ARMv7a, Cortex-A7)"
select ARCH_CORTEXA7
select ARCH_HAVE_MULTICPU
select ARMV7A_HAVE_GICv2
select ARMV7A_HAVE_PTM
select ARCH_HAVE_LOWVECTORS
select ARCH_HAVE_ADDRENV
select ARCH_NEED_ADDRENV_MAPPING
---help---
Rockchip RK3506 SoC. NuttX runs as an AMP subsystem on one of the
Cortex-A7 cores (CPU2), alongside Linux on the other cores. Brought
up by U-Boot via PSCI.

config ARCH_CHIP_GOLDFISH_ARM
bool "GOLDFISH virt platform (ARMv7a)"
select ARCH_HAVE_POWEROFF
Expand Down Expand Up @@ -1366,6 +1380,7 @@ config ARCH_CHIP
default "phy62xx" if ARCH_CHIP_PHY62XX
default "tlsr82" if ARCH_CHIP_TLSR82
default "qemu" if ARCH_CHIP_QEMU_ARM
default "rk3506" if ARCH_CHIP_RK3506
default "mps" if ARCH_CHIP_MPS
default "rtl8721dx" if ARCH_CHIP_RTL8721DX
default "rtl8720f" if ARCH_CHIP_RTL8720F
Expand Down Expand Up @@ -1935,6 +1950,9 @@ endif
if ARCH_CHIP_QEMU_ARM
source "arch/arm/src/qemu/Kconfig"
endif
if ARCH_CHIP_RK3506
source "arch/arm/src/rk3506/Kconfig"
endif
if ARCH_CHIP_MPS
source "arch/arm/src/mps/Kconfig"
endif
Expand Down
48 changes: 48 additions & 0 deletions arch/arm/include/rk3506/chip.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/****************************************************************************
* arch/arm/include/rk3506/chip.h
*
* SPDX-License-Identifier: Apache-2.0
*
* 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_ARM_INCLUDE_RK3506_CHIP_H
#define __ARCH_ARM_INCLUDE_RK3506_CHIP_H

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

#include <nuttx/config.h>

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

/****************************************************************************
* Public Types
****************************************************************************/

/****************************************************************************
* Public Data
****************************************************************************/

/****************************************************************************
* Public Functions Prototypes
****************************************************************************/

#endif /* __ARCH_ARM_INCLUDE_RK3506_CHIP_H */
71 changes: 71 additions & 0 deletions arch/arm/include/rk3506/irq.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/****************************************************************************
* arch/arm/include/rk3506/irq.h
*
* SPDX-License-Identifier: Apache-2.0
*
* 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.
*
****************************************************************************/

/* This file should never be included directly but, rather,
* only indirectly through nuttx/irq.h
*/

#ifndef __ARCH_ARM_INCLUDE_RK3506_IRQ_H
#define __ARCH_ARM_INCLUDE_RK3506_IRQ_H

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

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

#define NR_IRQS 220 /* Total number of interrupts */

/****************************************************************************
* Public Types
****************************************************************************/

/****************************************************************************
* Inline functions
****************************************************************************/

/****************************************************************************
* Public Data
****************************************************************************/

/****************************************************************************
* Public Function Prototypes
****************************************************************************/

#ifndef __ASSEMBLY__
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif

#undef EXTERN
#ifdef __cplusplus
}
#endif
#endif

#endif /* __ARCH_ARM_INCLUDE_RK3506_IRQ_H */
37 changes: 37 additions & 0 deletions arch/arm/src/rk3506/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# ##############################################################################
# arch/arm/src/qemu/CMakeLists.txt

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix the path in all file

#
# SPDX-License-Identifier: Apache-2.0
#
# 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 rk3506_boot.c rk3506_serial.c rk3506_irq.c rk3506_timer.c)

if(CONFIG_ARCH_ARMV7A)
list(APPEND SRCS rk3506_pgalloc.c rk3506_memorymap.c)
endif()

if(CONFIG_BUILD_KERNEL)
list(APPEND SRCS rk3506_pgalloc.c)
endif()

if(CONFIG_BUILD_PROTECTED)
list(APPEND SRCS qemu_userspace.c qemu_allocateheap.c)
endif()

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

if ARCH_CHIP_RK3506

menu "RK3506 Chip Selection"

config RK3506_AMP_SECONDARY
bool "Run as AMP secondary core (do not init GIC distributor)"
default y
---help---
When NuttX runs as an AMP subsystem alongside Linux on the same
SoC, the GIC distributor is owned/initialized by the Linux side.
This option makes NuttX initialize only its own GIC CPU interface
(GICC) and skip the distributor (GICD) initialization, so it does
not corrupt the configuration set up by Linux.

config RK3506_UART4
bool "UART4 (dw-apb-uart) console"
default y
---help---
RK3506 UART4 at 0xff0e0000, used as the NuttX console in the
default AMP configuration. Pins routed to CPU2 by the Linux
device tree.

config RK3506_UART3
bool "UART3 (dw-apb-uart)"
default n
---help---
RK3506 UART3 at 0xff0d0000, the secondary UART also routed to
CPU2 by the Linux device tree.

endmenu # "RK3506 Chip Selection"

endif # ARCH_CHIP_RK3506
36 changes: 36 additions & 0 deletions arch/arm/src/rk3506/Make.defs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
############################################################################
# arch/arm/src/qemu/Make.defs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

#
# SPDX-License-Identifier: Apache-2.0
#
# 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.
#
############################################################################

ifeq ($(CONFIG_ARCH_ARMV7A),y)
include armv7-a/Make.defs
endif

ifeq ($(CONFIG_ARCH_ARMV7R),y)
include armv7-r/Make.defs
endif

# rk3506-specific C source files
CHIP_CSRCS = rk3506_boot.c rk3506_serial.c rk3506_irq.c rk3506_timer.c

ifeq ($(CONFIG_ARCH_ARMV7A),y)
CHIP_CSRCS += rk3506_pgalloc.c rk3506_memorymap.c
endif
Loading
Loading