mirror of https://github.com/ARMmbed/mbed-os.git
CM3DS: merge the two system header files into one
This commit does not bring functional changes. Here is the list of changes: - merge CMSDK_CM3DS.h and SMM_MPS2.h into CM3DS.h - remove unused code - split copyright headers from first comment of each file Change-Id: I79b7ee01689439b7d2fde9d13035a5edf17f69ff Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>pull/6696/head
parent
cabef4db1d
commit
9f107d2c73
|
@ -61,31 +61,6 @@ typedef enum {
|
|||
SPI_NC = (SPI_4 + 1)
|
||||
} SPIName;
|
||||
|
||||
typedef enum {
|
||||
PWM_1 = 0,
|
||||
PWM_2,
|
||||
PWM_3,
|
||||
PWM_4,
|
||||
PWM_5,
|
||||
PWM_6,
|
||||
PWM_7,
|
||||
PWM_8,
|
||||
PWM_9,
|
||||
PWM_10,
|
||||
PWM_11
|
||||
} PWMName;
|
||||
|
||||
#define STDIO_UART_TX USBTX
|
||||
#define STDIO_UART_RX USBRX
|
||||
#define STDIO_UART UART_1
|
||||
|
||||
#define MBED_UART0 MCC_TX, MCC_RX
|
||||
#define MBED_UART1 USBTX, USBRX
|
||||
#define MBED_UART2 XB_TX, XB_RX
|
||||
#define MBED_UART3 SH0_TX, SH0_RX
|
||||
#define MBED_UART4 SH1_TX, SH1_RX
|
||||
#define MBED_UARTUSB USBTX, USBRX
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -18,6 +18,10 @@
|
|||
|
||||
#include "cmsis.h"
|
||||
|
||||
/* Pins used by mbed OS to identify STDIO UART pins */
|
||||
#define STDIO_UART_TX USBTX
|
||||
#define STDIO_UART_RX USBRX
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -27,8 +31,6 @@ typedef enum {
|
|||
PIN_OUTPUT
|
||||
} PinDirection;
|
||||
|
||||
#define PORT_SHIFT 5
|
||||
|
||||
typedef enum {
|
||||
/* MPS2 EXP Pin Names */
|
||||
EXP0 = 0,
|
||||
|
|
|
@ -1,90 +0,0 @@
|
|||
/* mbed Microcontroller Library
|
||||
* Copyright (c) 2006-2015 ARM Limited
|
||||
*
|
||||
* Licensed 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.
|
||||
* ----------------------------------------------------------------
|
||||
* File: fpga.c
|
||||
* Release: Version 1.0
|
||||
* ----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*
|
||||
* Code implementation file for the fpga functions.
|
||||
*/
|
||||
|
||||
#include "SMM_MPS2.h" // MPS2 common header
|
||||
|
||||
// Function to delay n*ticks (25MHz = 40nS per tick)
|
||||
// Used for I2C drivers
|
||||
void i2c_delay(unsigned int tick)
|
||||
{
|
||||
unsigned int end;
|
||||
unsigned int start;
|
||||
|
||||
start = MPS2_FPGAIO->COUNTER;
|
||||
end = start + (tick);
|
||||
|
||||
if(end >= start)
|
||||
{
|
||||
while (MPS2_FPGAIO->COUNTER >= start && MPS2_FPGAIO->COUNTER < end);
|
||||
}
|
||||
else
|
||||
{
|
||||
while (MPS2_FPGAIO->COUNTER >= start);
|
||||
while (MPS2_FPGAIO->COUNTER < end);
|
||||
}
|
||||
}
|
||||
|
||||
/* Sleep function to delay n*mS
|
||||
* Uses FPGA counter.
|
||||
*/
|
||||
void Sleepms(unsigned int msec)
|
||||
{
|
||||
unsigned int end;
|
||||
unsigned int start;
|
||||
|
||||
start = MPS2_FPGAIO->COUNTER;
|
||||
end = start + (25 * msec * 1000);
|
||||
|
||||
if(end >= start)
|
||||
{
|
||||
while (MPS2_FPGAIO->COUNTER >= start && MPS2_FPGAIO->COUNTER < end);
|
||||
}
|
||||
else
|
||||
{
|
||||
while (MPS2_FPGAIO->COUNTER >= start);
|
||||
while (MPS2_FPGAIO->COUNTER < end);
|
||||
}
|
||||
}
|
||||
|
||||
/* Sleep function to delay n*uS
|
||||
*/
|
||||
void Sleepus(unsigned int usec)
|
||||
{
|
||||
unsigned int end;
|
||||
unsigned int start;
|
||||
|
||||
start = MPS2_FPGAIO->COUNTER;
|
||||
end = start + (25 * usec);
|
||||
|
||||
if(end >= start)
|
||||
{
|
||||
while (MPS2_FPGAIO->COUNTER >= start && MPS2_FPGAIO->COUNTER < end);
|
||||
}
|
||||
else
|
||||
{
|
||||
while (MPS2_FPGAIO->COUNTER >= start);
|
||||
while (MPS2_FPGAIO->COUNTER < end);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
/* mbed Microcontroller Library
|
||||
* Copyright (c) 2006-2017 ARM Limited
|
||||
*
|
||||
* Licensed 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Code implementation file for the fpga functions.
|
||||
*/
|
||||
|
||||
#include "SMM_MPS2.h" // MPS2 common header
|
||||
|
||||
// Function to delay n*ticks (25MHz = 40nS per tick)
|
||||
// Used for I2C drivers
|
||||
void i2c_delay(unsigned int tick);
|
||||
|
||||
/* Sleep function to delay n*mS
|
||||
* Uses FPGA counter.
|
||||
*/
|
||||
void Sleepms(unsigned int msec);
|
||||
|
||||
/* Sleep function to delay n*uS
|
||||
*/
|
||||
void Sleepus(unsigned int usec);
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "CMSDK_CM3DS.h"
|
||||
#include "CM3DS.h"
|
||||
#include "timer_cmsdk_drv.h"
|
||||
|
||||
#define SEC_TO_USEC_MULTIPLIER 1000000U
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* mbed Microcontroller Library
|
||||
* Copyright (c) 2006-2017 ARM Limited
|
||||
* Copyright (c) 2006-2018 ARM Limited
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -13,6 +13,10 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file is included by every HAL implementations.
|
||||
*/
|
||||
#ifndef MBED_DEVICE_H
|
||||
#define MBED_DEVICE_H
|
||||
|
||||
|
|
|
@ -14,12 +14,21 @@
|
|||
* 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 is derivative of CMSIS V5.00 ARMCM3.h
|
||||
*/
|
||||
|
||||
#ifndef CMSDK_CM3DS_H
|
||||
#define CMSDK_CM3DS_H
|
||||
/*
|
||||
* This file is derivative of CMSIS V5.00 ARMCM3.h
|
||||
*
|
||||
* This file has merged with the former SMM_MPS2.h file, derivative from the
|
||||
* MPS2 Selftest implementation.
|
||||
* MPS2 Selftest: https://silver.arm.com/browse/VEI10 ->
|
||||
* \ISCM-1-0\AN491\software\Selftest\v2m_mps2\SMM_MPS2.h
|
||||
*
|
||||
* It includes code implementation file for the LAN Ethernet interface.
|
||||
*/
|
||||
|
||||
#ifndef CM3DS_H
|
||||
#define CM3DS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -40,7 +49,7 @@ typedef enum IRQn
|
|||
PendSV_IRQn = -2, /* 14 Pend SV Interrupt */
|
||||
SysTick_IRQn = -1, /* 15 System Tick Interrupt */
|
||||
|
||||
/* ---------------------- CMSDK_CM3 Specific Interrupt Numbers ------------------ */
|
||||
/* ---------------------- CM3DS Specific Interrupt Numbers ---------------------- */
|
||||
UART0_IRQn = 0, /* UART 0 RX and TX Combined Interrupt */
|
||||
Spare_IRQn = 1, /* Undefined */
|
||||
UART1_IRQn = 2, /* UART 1 RX and TX Combined Interrupt */
|
||||
|
@ -105,7 +114,7 @@ typedef enum IRQn
|
|||
/* ================================================================================ */
|
||||
|
||||
/* -------- Configuration of the Cortex-M3 Processor and Core Peripherals ------- */
|
||||
#define __CM3DS_REV 0x0201U /* Core revision r2p1 */
|
||||
#define __CM3DS_REV 0x0201U /* Core revision r2p1 */
|
||||
#define __MPU_PRESENT 1 /* MPU present or not */
|
||||
#define __VTOR_PRESENT 1 /* VTOR present or not */
|
||||
#define __NVIC_PRIO_BITS 3 /* Number of Bits used for Priority Levels */
|
||||
|
@ -122,7 +131,7 @@ typedef enum IRQn
|
|||
/* ------------------- Start of section using anonymous unions ------------------ */
|
||||
#if defined ( __CC_ARM )
|
||||
#pragma push
|
||||
#pragma anon_unions
|
||||
#pragma anon_unions
|
||||
#elif defined(__ICCARM__)
|
||||
#pragma language=extended
|
||||
#elif defined(__GNUC__)
|
||||
|
@ -221,53 +230,6 @@ typedef struct
|
|||
#define CMSDK_SYSCON_RSTINFO_LOCKUPRESET_Pos 2
|
||||
#define CMSDK_SYSCON_RSTINFO_LOCKUPRESET_Msk (0x00001ul << CMSDK_SYSCON_RSTINFO_LOCKUPRESET_Pos) /* CMSDK_SYSCON RSTINFO: LOCKUPRESET Mask */
|
||||
|
||||
/*------------------- WATCHDOG ----------------------------------------------*/
|
||||
typedef struct
|
||||
{
|
||||
|
||||
__IO uint32_t LOAD; /* Offset: 0x000 (R/W) Watchdog Load Register */
|
||||
__I uint32_t VALUE; /* Offset: 0x004 (R/ ) Watchdog Value Register */
|
||||
__IO uint32_t CTRL; /* Offset: 0x008 (R/W) Watchdog Control Register */
|
||||
__O uint32_t INTCLR; /* Offset: 0x00C ( /W) Watchdog Clear Interrupt Register */
|
||||
__I uint32_t RAWINTSTAT; /* Offset: 0x010 (R/ ) Watchdog Raw Interrupt Status Register */
|
||||
__I uint32_t MASKINTSTAT; /* Offset: 0x014 (R/ ) Watchdog Interrupt Status Register */
|
||||
uint32_t RESERVED0[762];
|
||||
__IO uint32_t LOCK; /* Offset: 0xC00 (R/W) Watchdog Lock Register */
|
||||
uint32_t RESERVED1[191];
|
||||
__IO uint32_t ITCR; /* Offset: 0xF00 (R/W) Watchdog Integration Test Control Register */
|
||||
__O uint32_t ITOP; /* Offset: 0xF04 ( /W) Watchdog Integration Test Output Set Register */
|
||||
}CMSDK_WATCHDOG_TypeDef;
|
||||
|
||||
#define CMSDK_WATCHDOG_LOAD_Pos 0 /* CMSDK_WATCHDOG LOAD: LOAD Position */
|
||||
#define CMSDK_WATCHDOG_LOAD_Msk (0xFFFFFFFFul << CMSDK_WATCHDOG_LOAD_Pos) /* CMSDK_WATCHDOG LOAD: LOAD Mask */
|
||||
|
||||
#define CMSDK_WATCHDOG_VALUE_Pos 0 /* CMSDK_WATCHDOG VALUE: VALUE Position */
|
||||
#define CMSDK_WATCHDOG_VALUE_Msk (0xFFFFFFFFul << CMSDK_WATCHDOG_VALUE_Pos) /* CMSDK_WATCHDOG VALUE: VALUE Mask */
|
||||
|
||||
#define CMSDK_WATCHDOG_CTRL_RESEN_Pos 1 /* CMSDK_WATCHDOG CTRL_RESEN: Enable Reset Output Position */
|
||||
#define CMSDK_WATCHDOG_CTRL_RESEN_Msk (0x1ul << CMSDK_WATCHDOG_CTRL_RESEN_Pos) /* CMSDK_WATCHDOG CTRL_RESEN: Enable Reset Output Mask */
|
||||
|
||||
#define CMSDK_WATCHDOG_CTRL_INTEN_Pos 0 /* CMSDK_WATCHDOG CTRL_INTEN: Int Enable Position */
|
||||
#define CMSDK_WATCHDOG_CTRL_INTEN_Msk (0x1ul << CMSDK_WATCHDOG_CTRL_INTEN_Pos) /* CMSDK_WATCHDOG CTRL_INTEN: Int Enable Mask */
|
||||
|
||||
#define CMSDK_WATCHDOG_INTCLR_Pos 0 /* CMSDK_WATCHDOG INTCLR: Int Clear Position */
|
||||
#define CMSDK_WATCHDOG_INTCLR_Msk (0x1ul << CMSDK_WATCHDOG_INTCLR_Pos) /* CMSDK_WATCHDOG INTCLR: Int Clear Mask */
|
||||
|
||||
#define CMSDK_WATCHDOG_RAWINTSTAT_Pos 0 /* CMSDK_WATCHDOG RAWINTSTAT: Raw Int Status Position */
|
||||
#define CMSDK_WATCHDOG_RAWINTSTAT_Msk (0x1ul << CMSDK_WATCHDOG_RAWINTSTAT_Pos) /* CMSDK_WATCHDOG RAWINTSTAT: Raw Int Status Mask */
|
||||
|
||||
#define CMSDK_WATCHDOG_MASKINTSTAT_Pos 0 /* CMSDK_WATCHDOG MASKINTSTAT: Mask Int Status Position */
|
||||
#define CMSDK_WATCHDOG_MASKINTSTAT_Msk (0x1ul << CMSDK_WATCHDOG_MASKINTSTAT_Pos) /* CMSDK_WATCHDOG MASKINTSTAT: Mask Int Status Mask */
|
||||
|
||||
#define CMSDK_WATCHDOG_LOCK_Pos 0 /* CMSDK_WATCHDOG LOCK: LOCK Position */
|
||||
#define CMSDK_WATCHDOG_LOCK_Msk (0x1ul << CMSDK_WATCHDOG_LOCK_Pos) /* CMSDK_WATCHDOG LOCK: LOCK Mask */
|
||||
|
||||
#define CMSDK_WATCHDOG_INTEGTESTEN_Pos 0 /* CMSDK_WATCHDOG INTEGTESTEN: Integration Test Enable Position */
|
||||
#define CMSDK_WATCHDOG_INTEGTESTEN_Msk (0x1ul << CMSDK_WATCHDOG_INTEGTESTEN_Pos) /* CMSDK_WATCHDOG INTEGTESTEN: Integration Test Enable Mask */
|
||||
|
||||
#define CMSDK_WATCHDOG_INTEGTESTOUTSET_Pos 1 /* CMSDK_WATCHDOG INTEGTESTOUTSET: Integration Test Output Set Position */
|
||||
#define CMSDK_WATCHDOG_INTEGTESTOUTSET_Msk (0x1ul << CMSDK_WATCHDOG_INTEGTESTOUTSET_Pos) /* CMSDK_WATCHDOG INTEGTESTOUTSET: Integration Test Output Set Mask */
|
||||
|
||||
/*------------------------- Real Time Clock(RTC) ----------------------------------------------*/
|
||||
typedef struct
|
||||
{
|
||||
|
@ -284,6 +246,93 @@ typedef struct
|
|||
#define CMSDK_RTC_ENABLE_Pos 0 /* CMSDK_RTC Enable: Real Time Clock Enable Position */
|
||||
#define CMSDK_RTC_ENABLE_Msk (0x1ul << CMSDK_RTC_ENABLE_Pos) /* CMSDK_RTC Enable: Real Time Clock Enable Mask */
|
||||
|
||||
/******************************************************************************/
|
||||
/* Audio and Touch Screen (I2C) Peripheral declaration */
|
||||
/******************************************************************************/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
union {
|
||||
__O uint32_t CONTROLS; // Offset: 0x000 CONTROL Set Register ( /W)
|
||||
__I uint32_t CONTROL; // Offset: 0x000 CONTROL Status Register (R/ )
|
||||
};
|
||||
__O uint32_t CONTROLC; // Offset: 0x004 CONTROL Clear Register ( /W)
|
||||
} MPS2_I2C_TypeDef;
|
||||
|
||||
/******************************************************************************/
|
||||
/* SMSC9220 Register Definitions */
|
||||
/******************************************************************************/
|
||||
|
||||
typedef struct // SMSC LAN9220
|
||||
{
|
||||
__I uint32_t RX_DATA_PORT; // Receive FIFO Ports (offset 0x0)
|
||||
uint32_t RESERVED1[0x7];
|
||||
__O uint32_t TX_DATA_PORT; // Transmit FIFO Ports (offset 0x20)
|
||||
uint32_t RESERVED2[0x7];
|
||||
|
||||
__I uint32_t RX_STAT_PORT; // Receive FIFO status port (offset 0x40)
|
||||
__I uint32_t RX_STAT_PEEK; // Receive FIFO status peek (offset 0x44)
|
||||
__I uint32_t TX_STAT_PORT; // Transmit FIFO status port (offset 0x48)
|
||||
__I uint32_t TX_STAT_PEEK; // Transmit FIFO status peek (offset 0x4C)
|
||||
|
||||
__I uint32_t ID_REV; // Chip ID and Revision (offset 0x50)
|
||||
__IO uint32_t IRQ_CFG; // Main Interrupt Configuration (offset 0x54)
|
||||
__IO uint32_t INT_STS; // Interrupt Status (offset 0x58)
|
||||
__IO uint32_t INT_EN; // Interrupt Enable Register (offset 0x5C)
|
||||
uint32_t RESERVED3; // Reserved for future use (offset 0x60)
|
||||
__I uint32_t BYTE_TEST; // Read-only byte order testing register 87654321h (offset 0x64)
|
||||
__IO uint32_t FIFO_INT; // FIFO Level Interrupts (offset 0x68)
|
||||
__IO uint32_t RX_CFG; // Receive Configuration (offset 0x6C)
|
||||
__IO uint32_t TX_CFG; // Transmit Configuration (offset 0x70)
|
||||
__IO uint32_t HW_CFG; // Hardware Configuration (offset 0x74)
|
||||
__IO uint32_t RX_DP_CTL; // RX Datapath Control (offset 0x78)
|
||||
__I uint32_t RX_FIFO_INF; // Receive FIFO Information (offset 0x7C)
|
||||
__I uint32_t TX_FIFO_INF; // Transmit FIFO Information (offset 0x80)
|
||||
__IO uint32_t PMT_CTRL; // Power Management Control (offset 0x84)
|
||||
__IO uint32_t GPIO_CFG; // General Purpose IO Configuration (offset 0x88)
|
||||
__IO uint32_t GPT_CFG; // General Purpose Timer Configuration (offset 0x8C)
|
||||
__I uint32_t GPT_CNT; // General Purpose Timer Count (offset 0x90)
|
||||
uint32_t RESERVED4; // Reserved for future use (offset 0x94)
|
||||
__IO uint32_t ENDIAN; // WORD SWAP Register (offset 0x98)
|
||||
__I uint32_t FREE_RUN; // Free Run Counter (offset 0x9C)
|
||||
__I uint32_t RX_DROP; // RX Dropped Frames Counter (offset 0xA0)
|
||||
__IO uint32_t MAC_CSR_CMD; // MAC CSR Synchronizer Command (offset 0xA4)
|
||||
__IO uint32_t MAC_CSR_DATA; // MAC CSR Synchronizer Data (offset 0xA8)
|
||||
__IO uint32_t AFC_CFG; // Automatic Flow Control Configuration (offset 0xAC)
|
||||
__IO uint32_t E2P_CMD; // EEPROM Command (offset 0xB0)
|
||||
__IO uint32_t E2P_DATA; // EEPROM Data (offset 0xB4)
|
||||
|
||||
} SMSC9220_TypeDef;
|
||||
|
||||
// SMSC9220 MAC Registers Indices
|
||||
#define SMSC9220_MAC_CR 0x1
|
||||
#define SMSC9220_MAC_ADDRH 0x2
|
||||
#define SMSC9220_MAC_ADDRL 0x3
|
||||
#define SMSC9220_MAC_HASHH 0x4
|
||||
#define SMSC9220_MAC_HASHL 0x5
|
||||
#define SMSC9220_MAC_MII_ACC 0x6
|
||||
#define SMSC9220_MAC_MII_DATA 0x7
|
||||
#define SMSC9220_MAC_FLOW 0x8
|
||||
#define SMSC9220_MAC_VLAN1 0x9
|
||||
#define SMSC9220_MAC_VLAN2 0xA
|
||||
#define SMSC9220_MAC_WUFF 0xB
|
||||
#define SMSC9220_MAC_WUCSR 0xC
|
||||
|
||||
// SMSC9220 PHY Registers Indices
|
||||
#define SMSC9220_PHY_BCONTROL 0x0
|
||||
#define SMSC9220_PHY_BSTATUS 0x1
|
||||
#define SMSC9220_PHY_ID1 0x2
|
||||
#define SMSC9220_PHY_ID2 0x3
|
||||
#define SMSC9220_PHY_ANEG_ADV 0x4
|
||||
#define SMSC9220_PHY_ANEG_LPA 0x5
|
||||
#define SMSC9220_PHY_ANEG_EXP 0x6
|
||||
#define SMSC9220_PHY_MCONTROL 0x17
|
||||
#define SMSC9220_PHY_MSTATUS 0x18
|
||||
#define SMSC9220_PHY_CSINDICATE 0x27
|
||||
#define SMSC9220_PHY_INTSRC 0x29
|
||||
#define SMSC9220_PHY_INTMASK 0x30
|
||||
#define SMSC9220_PHY_CS 0x31
|
||||
|
||||
/* -------------------- End of section using anonymous unions ------------------- */
|
||||
#if defined ( __CC_ARM )
|
||||
#pragma pop
|
||||
|
@ -303,50 +352,52 @@ typedef struct
|
|||
/* ================ Peripheral memory map ================ */
|
||||
/* ================================================================================ */
|
||||
|
||||
/* Peripheral and SRAM base address */
|
||||
#define CMSDK_FLASH_BASE (0x00000000UL)
|
||||
#define CMSDK_SRAM_BASE (0x20000000UL)
|
||||
#define CMSDK_PERIPH_BASE (0x40000000UL)
|
||||
|
||||
#define CMSDK_RAM_BASE (0x20000000UL)
|
||||
#define CMSDK_APB_BASE (0x40000000UL)
|
||||
#define CMSDK_AHB_BASE (0x40010000UL)
|
||||
|
||||
/* APB peripherals */
|
||||
#define CMSDK_TIMER0_BASE (CMSDK_APB_BASE + 0x0000UL)
|
||||
#define CMSDK_TIMER1_BASE (CMSDK_APB_BASE + 0x1000UL)
|
||||
#define CMSDK_DUALTIMER_BASE (CMSDK_APB_BASE + 0x2000UL)
|
||||
#define CMSDK_DUALTIMER_1_BASE (CMSDK_DUALTIMER_BASE)
|
||||
#define CMSDK_DUALTIMER_2_BASE (CMSDK_DUALTIMER_BASE + 0x20UL)
|
||||
#define CMSDK_UART0_BASE (CMSDK_APB_BASE + 0x4000UL)
|
||||
#define CMSDK_UART1_BASE (CMSDK_APB_BASE + 0x5000UL)
|
||||
#define CMSDK_UART2_BASE (0x4002C000UL)
|
||||
#define CMSDK_UART3_BASE (0x4002D000UL)
|
||||
#define CMSDK_UART4_BASE (0x4002E000UL)
|
||||
#define CMSDK_RTC_BASE (CMSDK_APB_BASE + 0x6000UL)
|
||||
#define CMSDK_WATCHDOG_BASE (CMSDK_APB_BASE + 0x8000UL)
|
||||
|
||||
/* AHB peripherals */
|
||||
#define CMSDK_GPIO0_BASE (CMSDK_AHB_BASE + 0x0000UL)
|
||||
#define CMSDK_GPIO1_BASE (CMSDK_AHB_BASE + 0x1000UL)
|
||||
#define CMSDK_GPIO2_BASE (CMSDK_AHB_BASE + 0x2000UL)
|
||||
#define CMSDK_GPIO3_BASE (CMSDK_AHB_BASE + 0x3000UL)
|
||||
#define CMSDK_GPIO4_BASE (0x40030000UL)
|
||||
#define CMSDK_GPIO5_BASE (0x40031000UL)
|
||||
#define CMSDK_SYSCTRL_BASE (CMSDK_AHB_BASE + 0xF000UL)
|
||||
|
||||
|
||||
#define CMSDK_TIMER0_BASE 0x40000000UL
|
||||
#define CMSDK_TIMER1_BASE 0x40001000UL
|
||||
#define CMSDK_DUALTIMER_BASE 0x40002000UL
|
||||
#define CMSDK_DUALTIMER_1_BASE 0x40002000UL
|
||||
#define CMSDK_DUALTIMER_2_BASE 0x40002020UL
|
||||
#define CMSDK_UART0_BASE 0x40004000UL
|
||||
#define CMSDK_UART1_BASE 0x40005000UL
|
||||
#define CMSDK_RTC_BASE 0x40006000UL
|
||||
#define CMSDK_WATCHDOG_BASE 0x40008000UL
|
||||
#define TRNG_BASE 0x4000F000UL
|
||||
#define CMSDK_GPIO0_BASE 0x40010000UL
|
||||
#define CMSDK_GPIO1_BASE 0x40011000UL
|
||||
#define CMSDK_GPIO2_BASE 0x40012000UL
|
||||
#define CMSDK_GPIO3_BASE 0x40013000UL
|
||||
#define CMSDK_SYSCTRL_BASE 0x4001F000UL
|
||||
#define MPS2_SSP0_BASE 0x40020000UL /* User SSP Base Address */
|
||||
#define MPS2_SSP1_BASE 0x40021000UL /* CLCD SSP Base Address */
|
||||
#define MPS2_TSC_I2C_BASE 0x40022000UL /* Touch Screen I2C Base Address */
|
||||
#define MPS2_AAIC_I2C_BASE 0x40023000UL /* Audio Interface I2C Base Address */
|
||||
#define MPS2_AAIC_I2S_BASE 0x40024000UL /* Audio Interface I2S Base Address */
|
||||
#define MPS2_SSP2_BASE 0x40025000UL /* ADC SSP Base Address */
|
||||
#define MPS2_SSP3_BASE 0x40026000UL /* Shield 0 SSP Base Address */
|
||||
#define MPS2_SSP4_BASE 0x40027000UL /* Shield 1 SSP Base Address */
|
||||
#define MPS2_FPGAIO_BASE 0x40028000UL /* FPGAIO Base Address */
|
||||
#define MPS2_SHIELD0_I2C_BASE 0x40029000UL /* I2C shield 0 Base Address */
|
||||
#define MPS2_SHIELD1_I2C_BASE 0x4002A000UL /* I2C shield 1 Base Address */
|
||||
#define CMSDK_UART2_BASE 0x4002C000UL
|
||||
#define CMSDK_UART3_BASE 0x4002D000UL
|
||||
#define CMSDK_UART4_BASE 0x4002E000UL
|
||||
#define MPS2_SCC_BASE 0x4002F000UL /* SCC Base Address */
|
||||
#define CMSDK_GPIO4_BASE 0x40030000UL
|
||||
#define CMSDK_GPIO5_BASE 0x40031000UL
|
||||
#define SMSC9220_BASE 0x40200000UL /* Ethernet SMSC9220 Base Address */
|
||||
#define MPS2_VGA_TEXT_BUFFER 0x41000000UL /* VGA Text Buffer Address */
|
||||
#define MPS2_VGA_BUFFER 0x41100000UL /* VGA Buffer Base Address */
|
||||
|
||||
/* ================================================================================ */
|
||||
/* ================ Peripheral declaration ================ */
|
||||
/* ================================================================================ */
|
||||
|
||||
#define CMSDK_RTC ((CMSDK_RTC_TypeDef *) CMSDK_RTC_BASE )
|
||||
#define CMSDK_WATCHDOG ((CMSDK_WATCHDOG_TypeDef *) CMSDK_WATCHDOG_BASE )
|
||||
#define CMSDK_SYSCON ((CMSDK_SYSCON_TypeDef *) CMSDK_SYSCTRL_BASE )
|
||||
#define SMSC9220 ((SMSC9220_TypeDef *) SMSC9220_BASE )
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CMSDK_CM3DS_H */
|
||||
#endif /* CM3DS_H */
|
|
@ -1,445 +0,0 @@
|
|||
/* MPS2 CMSIS Library
|
||||
*
|
||||
* Copyright (c) 2006-2018 ARM Limited
|
||||
*
|
||||
* Licensed 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.
|
||||
*
|
||||
* Code implementation file for the LAN Ethernet interface.
|
||||
*
|
||||
* This file is derivative from the MPS2 Selftest's ethernet implementation
|
||||
* MPS2 Selftest: https://silver.arm.com/browse/VEI10 ->
|
||||
* \ISCM-1-0\AN491\software\Selftest\v2m_mps2\SMM_MPS2.h
|
||||
*
|
||||
*******************************************************************************
|
||||
* File: smm_mps2.h
|
||||
* Release: Version 1.1
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef __SMM_MPS2_H
|
||||
#define __SMM_MPS2_H
|
||||
|
||||
#include "peripherallink.h" /* device specific header file */
|
||||
|
||||
#if defined ( __CC_ARM )
|
||||
#pragma anon_unions
|
||||
#endif
|
||||
|
||||
/******************************************************************************/
|
||||
/* FPGA System Register declaration */
|
||||
/******************************************************************************/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
__IO uint32_t LED; // Offset: 0x000 (R/W) LED connections
|
||||
// [31:2] : Reserved
|
||||
// [1:0] : LEDs
|
||||
uint32_t RESERVED1[1];
|
||||
__IO uint32_t BUTTON; // Offset: 0x008 (R/W) Buttons
|
||||
// [31:2] : Reserved
|
||||
// [1:0] : Buttons
|
||||
uint32_t RESERVED2[1];
|
||||
__IO uint32_t CLK1HZ; // Offset: 0x010 (R/W) 1Hz up counter
|
||||
__IO uint32_t CLK100HZ; // Offset: 0x014 (R/W) 100Hz up counter
|
||||
__IO uint32_t COUNTER; // Offset: 0x018 (R/W) Cycle Up Counter
|
||||
// Increments when 32-bit prescale counter reach zero
|
||||
__IO uint32_t PRESCALE; // Offset: 0x1C (R/W) Prescaler
|
||||
// Bit[31:0] : reload value for prescale counter
|
||||
__IO uint32_t PSCNTR; // Offset: 0x020 (R/W) 32-bit Prescale counter
|
||||
// current value of the pre-scaler counter
|
||||
// The Cycle Up Counter increment when the prescale down counter reach 0
|
||||
// The pre-scaler counter is reloaded with PRESCALE after reaching 0.
|
||||
uint32_t RESERVED4[10];
|
||||
__IO uint32_t MISC; // Offset: 0x04C (R/W) Misc control */
|
||||
// [31:10] : Reserved
|
||||
// [9] : SHIELD_1_SPI_nCS
|
||||
// [8] : SHIELD_0_SPI_nCS
|
||||
// [7] : ADC_SPI_nCS
|
||||
// [6] : CLCD_BL_CTRL
|
||||
// [5] : CLCD_RD
|
||||
// [4] : CLCD_RS
|
||||
// [3] : CLCD_RESET
|
||||
// [2] : RESERVED
|
||||
// [1] : SPI_nSS
|
||||
// [0] : CLCD_CS
|
||||
} MPS2_FPGAIO_TypeDef;
|
||||
|
||||
// MISC register bit definitions
|
||||
|
||||
#define CLCD_CS_Pos 0
|
||||
#define CLCD_CS_Msk (1UL<<CLCD_CS_Pos)
|
||||
#define SPI_nSS_Pos 1
|
||||
#define SPI_nSS_Msk (1UL<<SPI_nSS_Pos)
|
||||
#define CLCD_RESET_Pos 3
|
||||
#define CLCD_RESET_Msk (1UL<<CLCD_RESET_Pos)
|
||||
#define CLCD_RS_Pos 4
|
||||
#define CLCD_RS_Msk (1UL<<CLCD_RS_Pos)
|
||||
#define CLCD_RD_Pos 5
|
||||
#define CLCD_RD_Msk (1UL<<CLCD_RD_Pos)
|
||||
#define CLCD_BL_Pos 6
|
||||
#define CLCD_BL_Msk (1UL<<CLCD_BL_Pos)
|
||||
#define ADC_nCS_Pos 7
|
||||
#define ADC_nCS_Msk (1UL<<ADC_nCS_Pos)
|
||||
#define SHIELD_0_nCS_Pos 8
|
||||
#define SHIELD_0_nCS_Msk (1UL<<SHIELD_0_nCS_Pos)
|
||||
#define SHIELD_1_nCS_Pos 9
|
||||
#define SHIELD_1_nCS_Msk (1UL<<SHIELD_1_nCS_Pos)
|
||||
|
||||
/******************************************************************************/
|
||||
/* SCC Register declaration */
|
||||
/******************************************************************************/
|
||||
|
||||
typedef struct //
|
||||
{
|
||||
__IO uint32_t CFG_REG0; // Offset: 0x000 (R/W) Remaps block RAM to ZBT
|
||||
// [31:1] : Reserved
|
||||
// [0] 1 : REMAP BlockRam to ZBT
|
||||
__IO uint32_t LEDS; // Offset: 0x004 (R/W) Controls the MCC user LEDs
|
||||
// [31:8] : Reserved
|
||||
// [7:0] : MCC LEDs
|
||||
uint32_t RESERVED0[1];
|
||||
__I uint32_t SWITCHES; // Offset: 0x00C (R/ ) Denotes the state of the MCC user switches
|
||||
// [31:8] : Reserved
|
||||
// [7:0] : These bits indicate state of the MCC switches
|
||||
__I uint32_t CFG_REG4; // Offset: 0x010 (R/ ) Denotes the board revision
|
||||
// [31:4] : Reserved
|
||||
// [3:0] : Used by the MCC to pass PCB revision. 0 = A 1 = B
|
||||
uint32_t RESERVED1[35];
|
||||
__IO uint32_t SYS_CFGDATA_RTN; // Offset: 0x0A0 (R/W) User data register
|
||||
// [31:0] : Data
|
||||
__IO uint32_t SYS_CFGDATA_OUT; // Offset: 0x0A4 (R/W) User data register
|
||||
// [31:0] : Data
|
||||
__IO uint32_t SYS_CFGCTRL; // Offset: 0x0A8 (R/W) Control register
|
||||
// [31] : Start (generates interrupt on write to this bit)
|
||||
// [30] : R/W access
|
||||
// [29:26] : Reserved
|
||||
// [25:20] : Function value
|
||||
// [19:12] : Reserved
|
||||
// [11:0] : Device (value of 0/1/2 for supported clocks)
|
||||
__IO uint32_t SYS_CFGSTAT; // Offset: 0x0AC (R/W) Contains status information
|
||||
// [31:2] : Reserved
|
||||
// [1] : Error
|
||||
// [0] : Complete
|
||||
__IO uint32_t RESERVED2[20];
|
||||
__IO uint32_t SCC_DLL; // Offset: 0x100 (R/W) DLL Lock Register
|
||||
// [31:24] : DLL LOCK MASK[7:0] - Indicate if the DLL locked is masked
|
||||
// [23:16] : DLL LOCK MASK[7:0] - Indicate if the DLLs are locked or unlocked
|
||||
// [15:1] : Reserved
|
||||
// [0] : This bit indicates if all enabled DLLs are locked
|
||||
uint32_t RESERVED3[957];
|
||||
__I uint32_t SCC_AID; // Offset: 0xFF8 (R/ ) SCC AID Register
|
||||
// [31:24] : FPGA build number
|
||||
// [23:20] : V2M-MPS2 target board revision (A = 0, B = 1)
|
||||
// [19:11] : Reserved
|
||||
// [10] : if “1” SCC_SW register has been implemented
|
||||
// [9] : if “1” SCC_LED register has been implemented
|
||||
// [8] : if “1” DLL lock register has been implemented
|
||||
// [7:0] : number of SCC configuration register
|
||||
__I uint32_t SCC_ID; // Offset: 0xFFC (R/ ) Contains information about the FPGA image
|
||||
// [31:24] : Implementer ID: 0x41 = ARM
|
||||
// [23:20] : Application note IP variant number
|
||||
// [19:16] : IP Architecture: 0x4 =AHB
|
||||
// [15:4] : Primary part number: 386 = AN386
|
||||
// [3:0] : Application note IP revision number
|
||||
} MPS2_SCC_TypeDef;
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* Audio and Touch Screen (I2C) Peripheral declaration */
|
||||
/******************************************************************************/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
union {
|
||||
__O uint32_t CONTROLS; // Offset: 0x000 CONTROL Set Register ( /W)
|
||||
__I uint32_t CONTROL; // Offset: 0x000 CONTROL Status Register (R/ )
|
||||
};
|
||||
__O uint32_t CONTROLC; // Offset: 0x004 CONTROL Clear Register ( /W)
|
||||
} MPS2_I2C_TypeDef;
|
||||
|
||||
/******************************************************************************/
|
||||
/* Audio I2S Peripheral declaration */
|
||||
/******************************************************************************/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/*!< Offset: 0x000 CONTROL Register (R/W) */
|
||||
__IO uint32_t CONTROL; // <h> CONTROL </h>
|
||||
// <o.0> TX Enable
|
||||
// <0=> TX disabled
|
||||
// <1=> TX enabled
|
||||
// <o.1> TX IRQ Enable
|
||||
// <0=> TX IRQ disabled
|
||||
// <1=> TX IRQ enabled
|
||||
// <o.2> RX Enable
|
||||
// <0=> RX disabled
|
||||
// <1=> RX enabled
|
||||
// <o.3> RX IRQ Enable
|
||||
// <0=> RX IRQ disabled
|
||||
// <1=> RX IRQ enabled
|
||||
// <o.10..8> TX Buffer Water Level
|
||||
// <0=> / IRQ triggers when any space available
|
||||
// <1=> / IRQ triggers when more than 1 space available
|
||||
// <2=> / IRQ triggers when more than 2 space available
|
||||
// <3=> / IRQ triggers when more than 3 space available
|
||||
// <4=> Undefined!
|
||||
// <5=> Undefined!
|
||||
// <6=> Undefined!
|
||||
// <7=> Undefined!
|
||||
// <o.14..12> RX Buffer Water Level
|
||||
// <0=> Undefined!
|
||||
// <1=> / IRQ triggers when less than 1 space available
|
||||
// <2=> / IRQ triggers when less than 2 space available
|
||||
// <3=> / IRQ triggers when less than 3 space available
|
||||
// <4=> / IRQ triggers when less than 4 space available
|
||||
// <5=> Undefined!
|
||||
// <6=> Undefined!
|
||||
// <7=> Undefined!
|
||||
// <o.16> FIFO reset
|
||||
// <0=> Normal operation
|
||||
// <1=> FIFO reset
|
||||
// <o.17> Audio Codec reset
|
||||
// <0=> Normal operation
|
||||
// <1=> Assert audio Codec reset
|
||||
/*!< Offset: 0x004 STATUS Register (R/ ) */
|
||||
__I uint32_t STATUS; // <h> STATUS </h>
|
||||
// <o.0> TX Buffer alert
|
||||
// <0=> TX buffer don't need service yet
|
||||
// <1=> TX buffer need service
|
||||
// <o.1> RX Buffer alert
|
||||
// <0=> RX buffer don't need service yet
|
||||
// <1=> RX buffer need service
|
||||
// <o.2> TX Buffer Empty
|
||||
// <0=> TX buffer have data
|
||||
// <1=> TX buffer empty
|
||||
// <o.3> TX Buffer Full
|
||||
// <0=> TX buffer not full
|
||||
// <1=> TX buffer full
|
||||
// <o.4> RX Buffer Empty
|
||||
// <0=> RX buffer have data
|
||||
// <1=> RX buffer empty
|
||||
// <o.5> RX Buffer Full
|
||||
// <0=> RX buffer not full
|
||||
// <1=> RX buffer full
|
||||
union {
|
||||
/*!< Offset: 0x008 Error Status Register (R/ ) */
|
||||
__I uint32_t ERROR; // <h> ERROR </h>
|
||||
// <o.0> TX error
|
||||
// <0=> Okay
|
||||
// <1=> TX overrun/underrun
|
||||
// <o.1> RX error
|
||||
// <0=> Okay
|
||||
// <1=> RX overrun/underrun
|
||||
/*!< Offset: 0x008 Error Clear Register ( /W) */
|
||||
__O uint32_t ERRORCLR; // <h> ERRORCLR </h>
|
||||
// <o.0> TX error
|
||||
// <0=> Okay
|
||||
// <1=> Clear TX error
|
||||
// <o.1> RX error
|
||||
// <0=> Okay
|
||||
// <1=> Clear RX error
|
||||
};
|
||||
/*!< Offset: 0x00C Divide ratio Register (R/W) */
|
||||
__IO uint32_t DIVIDE; // <h> Divide ratio for Left/Right clock </h>
|
||||
// <o.9..0> TX error (default 0x80)
|
||||
/*!< Offset: 0x010 Transmit Buffer ( /W) */
|
||||
__O uint32_t TXBUF; // <h> Transmit buffer </h>
|
||||
// <o.15..0> Right channel
|
||||
// <o.31..16> Left channel
|
||||
/*!< Offset: 0x014 Receive Buffer (R/ ) */
|
||||
__I uint32_t RXBUF; // <h> Receive buffer </h>
|
||||
// <o.15..0> Right channel
|
||||
// <o.31..16> Left channel
|
||||
uint32_t RESERVED1[186];
|
||||
__IO uint32_t ITCR; // <h> Integration Test Control Register </h>
|
||||
// <o.0> ITEN
|
||||
// <0=> Normal operation
|
||||
// <1=> Integration Test mode enable
|
||||
__O uint32_t ITIP1; // <h> Integration Test Input Register 1</h>
|
||||
// <o.0> SDIN
|
||||
__O uint32_t ITOP1; // <h> Integration Test Output Register 1</h>
|
||||
// <o.0> SDOUT
|
||||
// <o.1> SCLK
|
||||
// <o.2> LRCK
|
||||
// <o.3> IRQOUT
|
||||
} MPS2_I2S_TypeDef;
|
||||
|
||||
#define I2S_CONTROL_TXEN_Pos 0
|
||||
#define I2S_CONTROL_TXEN_Msk (1UL<<I2S_CONTROL_TXEN_Pos)
|
||||
|
||||
#define I2S_CONTROL_TXIRQEN_Pos 1
|
||||
#define I2S_CONTROL_TXIRQEN_Msk (1UL<<I2S_CONTROL_TXIRQEN_Pos)
|
||||
|
||||
#define I2S_CONTROL_RXEN_Pos 2
|
||||
#define I2S_CONTROL_RXEN_Msk (1UL<<I2S_CONTROL_RXEN_Pos)
|
||||
|
||||
#define I2S_CONTROL_RXIRQEN_Pos 3
|
||||
#define I2S_CONTROL_RXIRQEN_Msk (1UL<<I2S_CONTROL_RXIRQEN_Pos)
|
||||
|
||||
#define I2S_CONTROL_TXWLVL_Pos 8
|
||||
#define I2S_CONTROL_TXWLVL_Msk (7UL<<I2S_CONTROL_TXWLVL_Pos)
|
||||
|
||||
#define I2S_CONTROL_RXWLVL_Pos 12
|
||||
#define I2S_CONTROL_RXWLVL_Msk (7UL<<I2S_CONTROL_RXWLVL_Pos)
|
||||
/* FIFO reset*/
|
||||
#define I2S_CONTROL_FIFORST_Pos 16
|
||||
#define I2S_CONTROL_FIFORST_Msk (1UL<<I2S_CONTROL_FIFORST_Pos)
|
||||
/* Codec reset*/
|
||||
#define I2S_CONTROL_CODECRST_Pos 17
|
||||
#define I2S_CONTROL_CODECRST_Msk (1UL<<I2S_CONTROL_CODECRST_Pos)
|
||||
|
||||
#define I2S_STATUS_TXIRQ_Pos 0
|
||||
#define I2S_STATUS_TXIRQ_Msk (1UL<<I2S_STATUS_TXIRQ_Pos)
|
||||
|
||||
#define I2S_STATUS_RXIRQ_Pos 1
|
||||
#define I2S_STATUS_RXIRQ_Msk (1UL<<I2S_STATUS_RXIRQ_Pos)
|
||||
|
||||
#define I2S_STATUS_TXEmpty_Pos 2
|
||||
#define I2S_STATUS_TXEmpty_Msk (1UL<<I2S_STATUS_TXEmpty_Pos)
|
||||
|
||||
#define I2S_STATUS_TXFull_Pos 3
|
||||
#define I2S_STATUS_TXFull_Msk (1UL<<I2S_STATUS_TXFull_Pos)
|
||||
|
||||
#define I2S_STATUS_RXEmpty_Pos 4
|
||||
#define I2S_STATUS_RXEmpty_Msk (1UL<<I2S_STATUS_RXEmpty_Pos)
|
||||
|
||||
#define I2S_STATUS_RXFull_Pos 5
|
||||
#define I2S_STATUS_RXFull_Msk (1UL<<I2S_STATUS_RXFull_Pos)
|
||||
|
||||
#define I2S_ERROR_TXERR_Pos 0
|
||||
#define I2S_ERROR_TXERR_Msk (1UL<<I2S_ERROR_TXERR_Pos)
|
||||
|
||||
#define I2S_ERROR_RXERR_Pos 1
|
||||
#define I2S_ERROR_RXERR_Msk (1UL<<I2S_ERROR_RXERR_Pos)
|
||||
|
||||
/******************************************************************************/
|
||||
/* SMSC9220 Register Definitions */
|
||||
/******************************************************************************/
|
||||
|
||||
typedef struct // SMSC LAN9220
|
||||
{
|
||||
__I uint32_t RX_DATA_PORT; // Receive FIFO Ports (offset 0x0)
|
||||
uint32_t RESERVED1[0x7];
|
||||
__O uint32_t TX_DATA_PORT; // Transmit FIFO Ports (offset 0x20)
|
||||
uint32_t RESERVED2[0x7];
|
||||
|
||||
__I uint32_t RX_STAT_PORT; // Receive FIFO status port (offset 0x40)
|
||||
__I uint32_t RX_STAT_PEEK; // Receive FIFO status peek (offset 0x44)
|
||||
__I uint32_t TX_STAT_PORT; // Transmit FIFO status port (offset 0x48)
|
||||
__I uint32_t TX_STAT_PEEK; // Transmit FIFO status peek (offset 0x4C)
|
||||
|
||||
__I uint32_t ID_REV; // Chip ID and Revision (offset 0x50)
|
||||
__IO uint32_t IRQ_CFG; // Main Interrupt Configuration (offset 0x54)
|
||||
__IO uint32_t INT_STS; // Interrupt Status (offset 0x58)
|
||||
__IO uint32_t INT_EN; // Interrupt Enable Register (offset 0x5C)
|
||||
uint32_t RESERVED3; // Reserved for future use (offset 0x60)
|
||||
__I uint32_t BYTE_TEST; // Read-only byte order testing register 87654321h (offset 0x64)
|
||||
__IO uint32_t FIFO_INT; // FIFO Level Interrupts (offset 0x68)
|
||||
__IO uint32_t RX_CFG; // Receive Configuration (offset 0x6C)
|
||||
__IO uint32_t TX_CFG; // Transmit Configuration (offset 0x70)
|
||||
__IO uint32_t HW_CFG; // Hardware Configuration (offset 0x74)
|
||||
__IO uint32_t RX_DP_CTL; // RX Datapath Control (offset 0x78)
|
||||
__I uint32_t RX_FIFO_INF; // Receive FIFO Information (offset 0x7C)
|
||||
__I uint32_t TX_FIFO_INF; // Transmit FIFO Information (offset 0x80)
|
||||
__IO uint32_t PMT_CTRL; // Power Management Control (offset 0x84)
|
||||
__IO uint32_t GPIO_CFG; // General Purpose IO Configuration (offset 0x88)
|
||||
__IO uint32_t GPT_CFG; // General Purpose Timer Configuration (offset 0x8C)
|
||||
__I uint32_t GPT_CNT; // General Purpose Timer Count (offset 0x90)
|
||||
uint32_t RESERVED4; // Reserved for future use (offset 0x94)
|
||||
__IO uint32_t ENDIAN; // WORD SWAP Register (offset 0x98)
|
||||
__I uint32_t FREE_RUN; // Free Run Counter (offset 0x9C)
|
||||
__I uint32_t RX_DROP; // RX Dropped Frames Counter (offset 0xA0)
|
||||
__IO uint32_t MAC_CSR_CMD; // MAC CSR Synchronizer Command (offset 0xA4)
|
||||
__IO uint32_t MAC_CSR_DATA; // MAC CSR Synchronizer Data (offset 0xA8)
|
||||
__IO uint32_t AFC_CFG; // Automatic Flow Control Configuration (offset 0xAC)
|
||||
__IO uint32_t E2P_CMD; // EEPROM Command (offset 0xB0)
|
||||
__IO uint32_t E2P_DATA; // EEPROM Data (offset 0xB4)
|
||||
|
||||
} SMSC9220_TypeDef;
|
||||
|
||||
// SMSC9220 MAC Registers Indices
|
||||
#define SMSC9220_MAC_CR 0x1
|
||||
#define SMSC9220_MAC_ADDRH 0x2
|
||||
#define SMSC9220_MAC_ADDRL 0x3
|
||||
#define SMSC9220_MAC_HASHH 0x4
|
||||
#define SMSC9220_MAC_HASHL 0x5
|
||||
#define SMSC9220_MAC_MII_ACC 0x6
|
||||
#define SMSC9220_MAC_MII_DATA 0x7
|
||||
#define SMSC9220_MAC_FLOW 0x8
|
||||
#define SMSC9220_MAC_VLAN1 0x9
|
||||
#define SMSC9220_MAC_VLAN2 0xA
|
||||
#define SMSC9220_MAC_WUFF 0xB
|
||||
#define SMSC9220_MAC_WUCSR 0xC
|
||||
|
||||
// SMSC9220 PHY Registers Indices
|
||||
#define SMSC9220_PHY_BCONTROL 0x0
|
||||
#define SMSC9220_PHY_BSTATUS 0x1
|
||||
#define SMSC9220_PHY_ID1 0x2
|
||||
#define SMSC9220_PHY_ID2 0x3
|
||||
#define SMSC9220_PHY_ANEG_ADV 0x4
|
||||
#define SMSC9220_PHY_ANEG_LPA 0x5
|
||||
#define SMSC9220_PHY_ANEG_EXP 0x6
|
||||
#define SMSC9220_PHY_MCONTROL 0x17
|
||||
#define SMSC9220_PHY_MSTATUS 0x18
|
||||
#define SMSC9220_PHY_CSINDICATE 0x27
|
||||
#define SMSC9220_PHY_INTSRC 0x29
|
||||
#define SMSC9220_PHY_INTMASK 0x30
|
||||
#define SMSC9220_PHY_CS 0x31
|
||||
|
||||
/******************************************************************************/
|
||||
/* Peripheral memory map */
|
||||
/******************************************************************************/
|
||||
|
||||
#define MPS2_SSP0_BASE (0x40020000ul) /* User SSP Base Address */
|
||||
#define MPS2_SSP1_BASE (0x40021000ul) /* CLCD SSP Base Address */
|
||||
#define MPS2_TSC_I2C_BASE (0x40022000ul) /* Touch Screen I2C Base Address */
|
||||
#define MPS2_AAIC_I2C_BASE (0x40023000ul) /* Audio Interface I2C Base Address */
|
||||
#define MPS2_AAIC_I2S_BASE (0x40024000ul) /* Audio Interface I2S Base Address */
|
||||
#define MPS2_SSP2_BASE (0x40025000ul) /* ADC SSP Base Address */
|
||||
#define MPS2_SSP3_BASE (0x40026000ul) /* Shield 0 SSP Base Address */
|
||||
#define MPS2_SSP4_BASE (0x40027000ul) /* Shield 1 SSP Base Address */
|
||||
#define MPS2_FPGAIO_BASE (0x40028000ul) /* FPGAIO Base Address */
|
||||
#define MPS2_SHIELD0_I2C_BASE (0x40029000ul) /* I2C shield 0 Base Address */
|
||||
#define MPS2_SHIELD1_I2C_BASE (0x4002A000ul) /* I2C shield 1 Base Address */
|
||||
#define MPS2_SCC_BASE (0x4002F000ul) /* SCC Base Address */
|
||||
|
||||
#define SMSC9220_BASE (0x40200000ul) /* Ethernet SMSC9220 Base Address */
|
||||
|
||||
#define MPS2_VGA_TEXT_BUFFER (0x41000000ul) /* VGA Text Buffer Address */
|
||||
#define MPS2_VGA_BUFFER (0x41100000ul) /* VGA Buffer Base Address */
|
||||
|
||||
/******************************************************************************/
|
||||
/* Peripheral declaration */
|
||||
/******************************************************************************/
|
||||
|
||||
#define SMSC9220 ((SMSC9220_TypeDef *) SMSC9220_BASE )
|
||||
#define MPS2_TS_I2C ((MPS2_I2C_TypeDef *) MPS2_TSC_I2C_BASE )
|
||||
#define MPS2_AAIC_I2C ((MPS2_I2C_TypeDef *) MPS2_AAIC_I2C_BASE )
|
||||
#define MPS2_SHIELD0_I2C ((MPS2_I2C_TypeDef *) MPS2_SHIELD0_I2C_BASE )
|
||||
#define MPS2_SHIELD1_I2C ((MPS2_I2C_TypeDef *) MPS2_SHIELD1_I2C_BASE )
|
||||
#define MPS2_AAIC_I2S ((MPS2_I2S_TypeDef *) MPS2_AAIC_I2S_BASE )
|
||||
#define MPS2_FPGAIO ((MPS2_FPGAIO_TypeDef *) MPS2_FPGAIO_BASE )
|
||||
#define MPS2_SCC ((MPS2_SCC_TypeDef *) MPS2_SCC_BASE )
|
||||
|
||||
/******************************************************************************/
|
||||
/* General Function Definitions */
|
||||
/******************************************************************************/
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* General MACRO Definitions */
|
||||
/******************************************************************************/
|
||||
|
||||
|
||||
|
||||
#endif /* __SMM_MPS2_H */
|
||||
|
|
@ -18,7 +18,9 @@
|
|||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
*************************************************************
|
||||
*** Scatter-Loading Description File ***
|
||||
*************************************************************
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
* 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 is derivative of CMSIS V5.00 startup_ARMCM3.s
|
||||
*
|
||||
*/
|
||||
|
||||
#include "memory_zones.h"
|
||||
|
|
|
@ -14,7 +14,9 @@
|
|||
* 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 is derivative of CMSIS V5.00 gcc_arm.ld
|
||||
*
|
||||
* Linker script for mbed CM3DS on MPS2
|
||||
|
|
|
@ -12,18 +12,17 @@
|
|||
* 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.
|
||||
*
|
||||
* A generic CMSIS include header, pulling in CM3DS and MPS2 specifics
|
||||
*/
|
||||
|
||||
/*
|
||||
* A generic CMSIS include header, pulling in CM3DS and MPS2 specifics.
|
||||
* This file is included by Mbed OS upper layers.
|
||||
*/
|
||||
|
||||
#ifndef MBED_CMSIS_H
|
||||
#define MBED_CMSIS_H
|
||||
|
||||
/* CM3DS Core */
|
||||
#include "CMSDK_CM3DS.h"
|
||||
/* MPS2 CMSIS Library */
|
||||
#include "SMM_MPS2.h"
|
||||
/* NVIC Driver */
|
||||
#include "cmsis_nvic.h"
|
||||
#include "CM3DS.h"
|
||||
|
||||
#endif /* MBED_CMSIS_H */
|
||||
|
|
|
@ -12,7 +12,9 @@
|
|||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* CMSIS-style functionality to support dynamic vectors
|
||||
*
|
||||
* This file is included in ARM and GCC_ARM linker scripts.
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#include "mbed_retarget.h"
|
||||
#include "mbed_wait_api.h"
|
||||
#include "SMM_MPS2.h"
|
||||
#include "CM3DS.h"
|
||||
#include "smsc9220_eth.h"
|
||||
|
||||
#define REG_WRITE_TIME_OUT 50
|
||||
|
@ -623,7 +623,7 @@ int smsc9220_send_by_chunks(unsigned int total_packet_length, int is_new_packet,
|
|||
unsigned int dwords_to_write = 0;
|
||||
unsigned int xmit_inf = 0;
|
||||
unsigned int tx_buffer_free_space = 0;
|
||||
volatile unsigned int xmit_stat = 0;
|
||||
unsigned int xmit_stat = 0;
|
||||
|
||||
if (!data) {
|
||||
return -1; /* Invalid input parameter */
|
||||
|
@ -677,7 +677,9 @@ int smsc9220_send_by_chunks(unsigned int total_packet_length, int is_new_packet,
|
|||
/* pop status port */
|
||||
/* for error check it should be checked "at a later time" according to data sheet */
|
||||
xmit_stat = SMSC9220->TX_STAT_PORT;
|
||||
(void)xmit_stat;
|
||||
}
|
||||
|
||||
ongoing_packet_length_sent += current_size;
|
||||
return 0;
|
||||
}
|
|
@ -12,7 +12,9 @@
|
|||
* 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 contains the information of memory zones for code and data on
|
||||
* CM3DS.
|
||||
* It is used in startup code and linker scripts of supported compilers (ARM and
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
/* MPS2 CMSIS Library
|
||||
*
|
||||
* Copyright (c) 2006-2017 ARM Limited
|
||||
*
|
||||
* Licensed 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 is derivative from the MPS2 Selftest implementation
|
||||
* MPS2 Selftest: https://silver.arm.com/browse/VEI10 ->
|
||||
* \ISCM-1-0\AN491\software\Selftest\v2m_mps2\peripherallink.h
|
||||
*
|
||||
*******************************************************************************
|
||||
* Name: peripherallink.h
|
||||
* Purpose: Include the correct device header file
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef __DEVICE_H
|
||||
#define __DEVICE_H
|
||||
|
||||
#if defined CMSDK_CM3DS
|
||||
#include "CMSDK_CM3DS.h" /* device specific header file */
|
||||
#else
|
||||
#warning "no appropriate header file found!"
|
||||
#endif
|
||||
|
||||
#endif /* __DEVICE_H */
|
|
@ -15,7 +15,8 @@
|
|||
*/
|
||||
|
||||
#include "platform_devices.h"
|
||||
#include "SMM_MPS2.h"
|
||||
/* Base addresses of peripherals */
|
||||
#include "CM3DS.h"
|
||||
|
||||
/* ARM CMSDK Timer driver structures */
|
||||
#ifdef ARM_CMSDK_TIMER0
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#ifndef __ARM_LTD_PLATFORM_DEVICES_H__
|
||||
#define __ARM_LTD_PLATFORM_DEVICES_H__
|
||||
|
||||
/* ======= Configures the peripheral set ======= */
|
||||
#include "device_cfg.h"
|
||||
|
||||
/* ======= Includes generic driver headers ======= */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2009-2017 ARM Limited. All rights reserved.
|
||||
* Copyright (c) 2009-2018 ARM Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
|
@ -14,7 +14,9 @@
|
|||
* 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 is derivative of CMSIS V5.00 system_ARMCM3.c
|
||||
*/
|
||||
|
||||
|
|
|
@ -14,7 +14,9 @@
|
|||
* 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 is derivative of CMSIS V5.00 system_ARMCM3.h
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* mbed Microcontroller Library
|
||||
* Copyright (c) 2017 ARM Limited
|
||||
* Copyright (c) 2017-2018 ARM Limited
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -17,7 +17,7 @@
|
|||
#include "cmsis.h"
|
||||
#include "mbed_error.h"
|
||||
#include "mbed_wait_api.h"
|
||||
#include "SMM_MPS2.h"
|
||||
#include "CM3DS.h"
|
||||
#include "pinmap.h"
|
||||
|
||||
/*
|
||||
|
|
|
@ -58,15 +58,6 @@ struct i2c_s {
|
|||
uint32_t freq_us; /* Stores I2C frequency in microseconds */
|
||||
};
|
||||
|
||||
struct tsc_s {
|
||||
MPS2_I2C_TypeDef *tsc;
|
||||
};
|
||||
|
||||
struct audio_s {
|
||||
MPS2_I2S_TypeDef *audio_I2S;
|
||||
MPS2_I2C_TypeDef *audio_I2C;
|
||||
};
|
||||
|
||||
struct spi_s {
|
||||
struct spi_pl022_dev_t *spi;
|
||||
};
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
#include "tztrng.h"
|
||||
|
||||
#define BITS_PER_BYTE 8
|
||||
/* Base address of the TRNG peripheral */
|
||||
#define TRNG_BASE 0x4000F000
|
||||
|
||||
void trng_init(trng_t *obj)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue