Skip to content

Commit cf4f584

Browse files
authored
Merge pull request #13639 from mbedNoobNinja/TARGET_UPDATE
Add SD, USBDEVICE & LPTICKER support for VK_RZ_A1H board.
2 parents f63b4b6 + efe5331 commit cf4f584

File tree

19 files changed

+803
-107
lines changed

19 files changed

+803
-107
lines changed

targets/TARGET_RENESAS/TARGET_RZ_A1XX/PeripheralPins.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,17 @@ extern const PinMap PinMap_PWM[];
6161
extern const PinMap PinMap_CAN_RD[];
6262
extern const PinMap PinMap_CAN_TD[];
6363

64+
#if DEVICE_SDHI
65+
/************SDHI***************/
66+
extern const PinMap PinMap_SDHI_WP[];
67+
extern const PinMap PinMap_SDHI_CD[];
68+
extern const PinMap PinMap_SDHI_CLK[];
69+
extern const PinMap PinMap_SDHI_CMD[];
70+
extern const PinMap PinMap_SDHI_D0[];
71+
extern const PinMap PinMap_SDHI_D1[];
72+
extern const PinMap PinMap_SDHI_D2[];
73+
extern const PinMap PinMap_SDHI_D3[];
6474
#endif
75+
76+
#endif
77+

targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_VK_RZ_A1H/PeripheralNames.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ typedef enum {
9797
CAN_4,
9898
} CANName;
9999

100+
typedef enum {
101+
SDHI_0 = 0,
102+
SDHI_1
103+
} SDHIName;
104+
100105

101106
#define STDIO_UART_TX USBTX
102107
#define STDIO_UART_RX USBRX

targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_VK_RZ_A1H/PeripheralPins.c

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,3 +538,51 @@ const PinMap PinMap_CAN_TD[] = {
538538
#endif
539539
};
540540

541+
const PinMap PinMap_SDHI_D0[] = {
542+
{P4_11 , SDHI_0, 3},
543+
{P3_11 , SDHI_1, 7},
544+
{NC , NC , 0}
545+
};
546+
547+
const PinMap PinMap_SDHI_D1[] = {
548+
{P4_10 , SDHI_0, 3},
549+
{P3_10 , SDHI_1, 7},
550+
{NC , NC , 0}
551+
};
552+
553+
const PinMap PinMap_SDHI_D2[] = {
554+
{P4_15 , SDHI_0, 3},
555+
{P3_15 , SDHI_1, 7},
556+
{NC , NC , 0}
557+
};
558+
559+
const PinMap PinMap_SDHI_D3[] = {
560+
{P4_14 , SDHI_0, 3},
561+
{P3_14 , SDHI_1, 7},
562+
{NC , NC , 0}
563+
};
564+
565+
const PinMap PinMap_SDHI_CLK[] = {
566+
{P4_12 , SDHI_0, 3},
567+
{P3_12 , SDHI_1, 7},
568+
{NC , NC , 0}
569+
};
570+
571+
const PinMap PinMap_SDHI_CMD[] = {
572+
{P4_13 , SDHI_0, 3},
573+
{P3_13 , SDHI_1, 7},
574+
{NC , NC , 0}
575+
};
576+
577+
const PinMap PinMap_SDHI_CD[] = {
578+
{P4_8 , SDHI_0, 3},
579+
{P3_8 , SDHI_1, 7},
580+
{NC , NC , 0}
581+
};
582+
583+
const PinMap PinMap_SDHI_WP[] = {
584+
{P4_9 , SDHI_0, 3},
585+
{P3_9 , SDHI_1, 7},
586+
{NC , NC , 0}
587+
};
588+

targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_VK_RZ_A1H/device/TOOLCHAIN_ARM_STD/VKRZA1H.sct

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,22 @@
1212
#ifdef RUN_FROM_SDRAM
1313
#define __ROM_BASE 0x08000000
1414
#define __ROM_SIZE 0x02000000
15-
#define __VECTOR_BASE 0x08000000
1615
#define __DATA_BASE +0 ALIGN 0x100000
1716
#elif defined (RUN_FROM_SRAM)
1817
#define __ROM_BASE 0x200A0000
1918
#define __ROM_SIZE 0x00960000
20-
#define __VECTOR_BASE 0x200A0000
2119
#define __DATA_BASE +0 ALIGN 0x100000 NOCOMPRESS
2220
#else
23-
#define __ROM_BASE 0x18020000
24-
#define __ROM_SIZE 0x01FE0000
25-
#define __VECTOR_BASE 0x18020000
21+
#if !defined(MBED_APP_START)
22+
#define MBED_APP_START 0x18020000
23+
#endif
24+
25+
#if !defined(MBED_APP_SIZE)
26+
#define MBED_APP_SIZE 0x1FE0000
27+
#endif
28+
29+
#define __ROM_BASE MBED_APP_START
30+
#define __ROM_SIZE MBED_APP_SIZE
2631
#define __DATA_BASE 0x20020000
2732
#endif
2833

@@ -56,7 +61,7 @@ LOAD_TTB __TTB_BASE __TTB_SIZE ; Page 0 of On-Chip Data Retention RAM
5661

5762
LR_IROM1 __ROM_BASE __ROM_SIZE ; load region size_region
5863
{
59-
VECTORS __VECTOR_BASE FIXED
64+
VECTORS __ROM_BASE FIXED
6065
{
6166
* (RESET, +FIRST) ; Vector table and other startup code
6267
* (InRoot$$Sections) ; All (library) code that must be in a root region
@@ -66,13 +71,16 @@ LR_IROM1 __ROM_BASE __ROM_SIZE ; load region size_region
6671
RO_DATA +0
6772
{ * (+RO-DATA) } ; Application RO data (.constdata)
6873

69-
RW_DATA __DATA_BASE
74+
RAM_CODE __DATA_BASE
75+
{ * (RAM_CODE) } ; Application RAM_CODE
76+
77+
RW_DATA +0 ALIGN 0x8
7078
{ * (+RW) } ; Application RW data (.data)
7179

7280
RW_IRAM1 +0 ALIGN 0x10
7381
{ * (+ZI) } ; Application ZI data (.bss)
7482

75-
ARM_LIB_HEAP +0
83+
ARM_LIB_HEAP +0 ALIGN 0x8
7684
{ * (HEAP) } ; Application heap area (HEAP)
7785

7886
ARM_LIB_STACK (__RAM_BASE + __NM_RAM_SIZE) EMPTY -__STACK_SIZE ; Stack region growing down

targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_VK_RZ_A1H/device/TOOLCHAIN_ARM_STD/sys.cpp

Lines changed: 0 additions & 61 deletions
This file was deleted.

targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_VK_RZ_A1H/device/TOOLCHAIN_GCC_ARM/VKRZA1H.ld

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* Linker script for mbed VK_RZ_A1H */
22

33
/* Linker script to configure memory regions. */
4-
/*
4+
55
#ifdef RUN_FROM_SDRAM
66
MEMORY
77
{
@@ -11,7 +11,7 @@ MEMORY
1111
SRAM (rwx) : ORIGIN = 0x200A0000, LENGTH = 0x00960000
1212
}
1313
REGION_ALIAS("SFLASH", RAM);
14-
TTBOFFSET = 1M;
14+
/*TTBOFFSET = 1M;*/
1515

1616
#elif defined (RUN_FROM_SRAM)
1717
MEMORY
@@ -22,19 +22,30 @@ MEMORY
2222
SDRAM (rwx) : ORIGIN = 0x08000000, LENGTH = 0x02000000
2323
}
2424
REGION_ALIAS("SFLASH", RAM);
25-
TTBOFFSET = 1M;
25+
/*TTBOFFSET = 1M;*/
2626
#else
27-
*/
27+
28+
#if !defined(MBED_APP_START)
29+
#define MBED_APP_START 0x18020000
30+
#endif
31+
32+
#if !defined(MBED_APP_SIZE)
33+
#define MBED_APP_SIZE 0x1FE0000
34+
#endif
35+
36+
#define SFLASH_ADDR MBED_APP_START
37+
#define SFLASH_SIZE MBED_APP_SIZE
38+
2839
MEMORY
2940
{
3041
ROM (rx) : ORIGIN = 0x00000000, LENGTH = 0x02000000
31-
SFLASH (rx) : ORIGIN = 0x18020000, LENGTH = 0x01FE0000
42+
SFLASH (rx) : ORIGIN = SFLASH_ADDR, LENGTH = SFLASH_SIZE
3243
L_TTB (rw) : ORIGIN = 0x20000000, LENGTH = 0x00004000
3344
RAM (rwx) : ORIGIN = 0x20020000, LENGTH = 0x008E0000
3445
RAM_NC (rwx) : ORIGIN = 0x20900000, LENGTH = 0x00100000
3546
SDRAM (rwx) : ORIGIN = 0x08000000, LENGTH = 0x02000000
3647
}
37-
/*#endif*/
48+
#endif
3849

3950
/* Linker script to place sections and symbol values. Should be used together
4051
* with other linker script that defines memory regions FLASH and RAM.
@@ -122,6 +133,9 @@ SECTIONS
122133
LONG (__etext2)
123134
LONG (__nc_data_start)
124135
LONG (__nc_data_end - __nc_data_start)
136+
LONG (LOADADDR(.ram_code))
137+
LONG (ADDR(.ram_code))
138+
LONG (SIZEOF(.ram_code))
125139
__copy_table_end__ = .;
126140
} > SFLASH
127141

@@ -136,7 +150,21 @@ SECTIONS
136150
__zero_table_end__ = .;
137151
} > SFLASH
138152

139-
__etext = .;
153+
.ram_code : ALIGN( 0x8 ) {
154+
__ram_code_load = .;
155+
__ram_code_start = LOADADDR(.ram_code) + ( __ram_code_load - ADDR(.ram_code) );
156+
157+
*(RAM_CODE)
158+
159+
*(RAM_CONST)
160+
161+
. = ALIGN( 0x8 );
162+
__ram_code_end = LOADADDR(.ram_code) + ( . - ADDR(.ram_code) );
163+
} > RAM AT > SFLASH
164+
165+
Load$$SEC_RAM_CODE$$Base = LOADADDR(.ram_code);
166+
Image$$SEC_RAM_CODE$$Base = ADDR(.ram_code);
167+
Load$$SEC_RAM_CODE$$Length = SIZEOF(.ram_code);
140168

141169
.ttb :
142170
{
@@ -145,6 +173,8 @@ SECTIONS
145173
Image$$TTB$$ZI$$Limit = .;
146174
} > L_TTB
147175

176+
__etext = Load$$SEC_RAM_CODE$$Base + SIZEOF(.ram_code);
177+
148178
.data : AT (__etext)
149179
{
150180
Image$$RW_DATA$$Base = .;

targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_VK_RZ_A1H/device/TOOLCHAIN_GCC_ARM/startup_VKRZ1AH.S

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -216,27 +216,4 @@ goToSleep:
216216
.pool
217217
.size Reset_Handler, . - Reset_Handler
218218

219-
220-
.text
221-
222-
/* Macro to define default handlers. Default handler
223-
* will be weak symbol and just dead loops. They can be
224-
* overwritten by other handlers */
225-
.macro def_default_handler handler_name
226-
.align 1
227-
.thumb_func
228-
.weak \handler_name
229-
.type \handler_name, %function
230-
\handler_name :
231-
b .
232-
.size \handler_name, . - \handler_name
233-
.endm
234-
235-
def_default_handler Undef_Handler
236-
def_default_handler SVC_Handler
237-
def_default_handler PAbt_Handler
238-
def_default_handler DAbt_Handler
239-
def_default_handler IRQ_Handler
240-
def_default_handler FIQ_Handler
241-
242-
.END
219+
.end

0 commit comments

Comments
 (0)