Skip to content

Commit 93305ca

Browse files
committed
lib: Add RDA8910 soc related files
Signed-off-by: Ajay Bhargav <[email protected]>
1 parent 81b04d4 commit 93305ca

File tree

6 files changed

+1253
-0
lines changed

6 files changed

+1253
-0
lines changed

lib/rda8910/app_flashimg.ld

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
/* Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
2+
* All rights reserved.
3+
*
4+
* This software is supplied "AS IS" without any warranties.
5+
* RDA assumes no responsibility or liability for the use of the software,
6+
* conveys no license or title under any patent, copyright, or mask work
7+
* right to the product. RDA reserves the right to make changes in the
8+
* software without notification. RDA also make no representation or
9+
* warranty that such application will be suitable for the specified use
10+
* without further testing or modification.
11+
*/
12+
13+
#include "hal_config.h"
14+
15+
#ifdef CONFIG_CPU_MIPS
16+
#undef mips
17+
#define mips mips
18+
OUTPUT_ARCH(mips)
19+
#endif
20+
21+
#ifdef CONFIG_CPU_ARM
22+
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
23+
OUTPUT_ARCH(arm)
24+
#endif
25+
26+
ENTRY(appimg_enter)
27+
EXTERN(appimg_enter)
28+
EXTERN(appimg_exit)
29+
EXTERN(appimg_get_param)
30+
EXTERN(appimg_set_param)
31+
PROVIDE(appimg_get_param = 0);
32+
PROVIDE(appimg_set_param = 0);
33+
34+
#define ALIGNMENT ALIGN(0x20)
35+
#define HEADER_APP_IMG LONG(0x41505032) \
36+
LONG(0) \
37+
LONG(0) \
38+
KEEP(*(.rodata.core_stub.header))
39+
#define HEADER_LOAD(t, n) LONG(t) \
40+
LONG(__##n##_load_start - __flash_start) \
41+
LONG(__##n##_end - __##n##_start) \
42+
LONG(__##n##_start)
43+
#define HEADER_CLEAR(n) LONG(3) \
44+
LONG(0) \
45+
LONG(__##n##_end - __##n##_start) \
46+
LONG(__##n##_start)
47+
#define HEADER_DUMMY LONG(0) LONG(0) LONG(0) LONG(0)
48+
49+
#define DEF_RO .text .text.* .gnu.linkonce.t.* .plt .rdata .rodata .rodata.* .constdata .constdata.* .gnu.linkonce.r.* .glue_7 .glue_7t .vfp11_veneer .v4_bx vtable
50+
#define DEF_RW .data_begin .data_begin.* .data .data.* .gnu.linkonce.d.* .got.plt .got .shdata .data_end .data_end.*
51+
#define DEF_ZI .bss_begin .bss_begin.* .shbss .bss .bss.* COMMON .scommon .sbss .sbss.* .sbss2 .sbss2.* .gnu.linkonce.b.* .bss_end .bss_end.*
52+
53+
/* Core mapped symbols */
54+
strtol = _strtol;
55+
strtoll = _strtoll;
56+
strtoul = _strtoul;
57+
strtoull = _strtoll;
58+
_strtol_r = __strtol_r;
59+
_strtoll_r = __strtoll_r;
60+
_strtoul_r = __strtoul_r;
61+
_strtoull_r = __strtoull_r;
62+
_strtod_l = __strtod_l;
63+
_strerror_r = __strerror_r;
64+
_svfprintf_r = __svfprintf_r;
65+
_vsnprintf_r = __vsnprintf_r;
66+
_fflush_r = __fflush_r;
67+
__ssvfiscanf_r = ___ssvfiscanf_r;
68+
_vfprintf_r = __vfprintf_r;
69+
_svfiprintf_r = __svfiprintf_r;
70+
__ssvfscanf_r = ___ssvfscanf_r;
71+
__sflush_r = ___sflush_r;
72+
__sfvwrite_r = ___sfvwrite_r;
73+
_fclose_r = __fclose_r;
74+
_strerror_r = __strerror_r;
75+
_strtod_l = __strtod_l;
76+
_tzset_unlocked_r = __tzset_unlocked_r;
77+
__tzcalc_limits = ___tzcalc_limits;
78+
gmtime_r = _gmtime_r;
79+
80+
MEMORY {
81+
flash (rx): ORIGIN = CONFIG_APPIMG_FLASH_ADDRESS, LENGTH = CONFIG_APPIMG_FLASH_SIZE
82+
ram (rwx): ORIGIN = CONFIG_RAM_PHY_ADDRESS+CONFIG_APP_FLASHIMG_RAM_OFFSET, LENGTH = CONFIG_APP_FLASHIMG_RAM_SIZE
83+
}
84+
85+
SECTIONS {
86+
. = ORIGIN(flash);
87+
__flash_start = .;
88+
89+
.imageheader : {
90+
HEADER_APP_IMG
91+
HEADER_LOAD(2, corestub)
92+
HEADER_LOAD(4, text)
93+
HEADER_LOAD(4, init_array)
94+
HEADER_LOAD(1, data)
95+
HEADER_CLEAR(bss)
96+
HEADER_DUMMY
97+
} > flash
98+
99+
ASSERT(SIZEOF(.imageheader) == 128, "invalid app image header")
100+
.initdata ALIGNMENT : {
101+
KEEP(*(.appinit));
102+
} > flash
103+
104+
. = ORIGIN(ram);
105+
__ram_start = .;
106+
107+
.corestub ALIGNMENT : {
108+
__corestub_start = .;
109+
*(.text.core_stub.*)
110+
__corestub_end = .;
111+
. = ALIGNMENT;
112+
__corestub_load_start = LOADADDR(.corestub);
113+
} AT>flash
114+
115+
.data ALIGNMENT : {
116+
__data_start = .;
117+
*(DEF_RW)
118+
__data_end = .;
119+
. = ALIGNMENT;
120+
__data_load_start = LOADADDR(.data);
121+
} AT>flash
122+
123+
.bss ALIGNMENT : {
124+
__bss_start = .;
125+
*(DEF_ZI)
126+
__bss_end = .;
127+
. = ALIGNMENT;
128+
}
129+
130+
. = LOADADDR(.corestub) + SIZEOF(.corestub) + SIZEOF(.data);
131+
132+
.text ALIGNMENT : {
133+
__text_start = .;
134+
KEEP(*(.appinit));
135+
*(DEF_RO)
136+
KEEP(*(.eh_frame*))
137+
__text_end = .;
138+
. = ALIGNMENT;
139+
__text_load_start = LOADADDR(.text);
140+
} > flash
141+
142+
.ll ALIGNMENT : {
143+
PROVIDE_HIDDEN (__ll_entry_start = .);
144+
KEEP( *(SORT(.ll_entry_cmdlist*)) );
145+
PROVIDE_HIDDEN (__ll_entry_end = .);
146+
} > flash
147+
148+
/* ARM magic sections */
149+
.ARM.extab ALIGNMENT : {
150+
*(.ARM.extab* .gnu.linkonce.armextab.*)
151+
} > flash
152+
153+
__exidx_start = .;
154+
.ARM.exidx ALIGNMENT : {
155+
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
156+
} > flash
157+
__exidx_end = .;
158+
159+
.init_array ALIGNMENT : {
160+
__init_array_start = .;
161+
KEEP(*(.init_array .init_array.*))
162+
__init_array_end = .;
163+
. = ALIGNMENT;
164+
__init_array_load_start = LOADADDR(.init_array);
165+
} > flash
166+
167+
__flash_end = ADDR(.init_array) + SIZEOF(.init_array);
168+
__ram_end = ADDR(.bss) + SIZEOF(.bss);
169+
170+
ASSERT(__flash_end <= ORIGIN(flash) + LENGTH(flash), "FLASH overflow")
171+
ASSERT(__ram_end <= ORIGIN(ram) + LENGTH(ram), "RAM overflow")
172+
173+
.comment 0 : { *(.comment) }
174+
/DISCARD/ : { *(.dynstr*) }
175+
/DISCARD/ : { *(.dynamic*) }
176+
/DISCARD/ : { *(.plt*) }
177+
/DISCARD/ : { *(.interp*) }
178+
/DISCARD/ : { *(.gnu*) }
179+
}

lib/rda8910/core_config.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"CONFIG_FDL1_IMAGE_START": "0x8000c0",
3+
"CONFIG_FDL1_IMAGE_SIZE": "0xff40",
4+
"CONFIG_FDL2_IMAGE_START": "0x810000",
5+
"CONFIG_FDL2_IMAGE_SIZE": "0x30000",
6+
"CONFIG_BOOT_FLASH_ADDRESS": "0x60000000",
7+
"CONFIG_BOOT_FLASH_SIZE": "0x10000",
8+
"CONFIG_APP_FLASH_ADDRESS": "0x60010000",
9+
"CONFIG_APP_FLASH_SIZE": "0x220000",
10+
"CONFIG_APPIMG_FLASH_ADDRESS": "0x60230000",
11+
"CONFIG_APPIMG_FLASH_SIZE": "0x100000",
12+
"CONFIG_FS_SYS_FLASH_ADDRESS": "0x60330000",
13+
"CONFIG_FS_SYS_FLASH_SIZE": "0x170000",
14+
"CONFIG_FS_MODEM_FLASH_ADDRESS": "0x604a0000",
15+
"CONFIG_FS_MODEM_FLASH_SIZE": "0x340000",
16+
"CONFIG_FS_FACTORY_FLASH_ADDRESS": "0x607e0000",
17+
"CONFIG_FS_FACTORY_FLASH_SIZE": "0x20000"
18+
}

lib/rda8910/fdl1.img

12.6 KB
Binary file not shown.

lib/rda8910/fdl2.img

50.6 KB
Binary file not shown.

lib/rda8910/fota8910.xml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<!--
2+
Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
3+
All rights reserved.
4+
5+
This software is supplied "AS IS" without any warranties.
6+
RDA assumes no responsibility or liability for the use of the software,
7+
conveys no license or title under any patent, copyright, or mask work
8+
right to the product. RDA reserves the right to make changes in the
9+
software without notification. RDA also make no representation or
10+
warranty that such application will be suitable for the specified use
11+
without further testing or modification.
12+
-->
13+
14+
<!--
15+
Most likely the configuration is suitable. And it can be changed if needed.
16+
17+
Method is patch method fine tune. The default method is "diff":
18+
* diff: (default option) create differential patch
19+
* ignore: not touch the file
20+
* remove: remove the file forcedly
21+
* replace: remove the file if exists, and insert with new content
22+
-->
23+
24+
<pacdiff>
25+
<!-- The default AP application ID is "AP", and it runs on FLASH. -->
26+
<pacflash id="AP" flash="SFL1" blocksize="0x10000" bundleblock="0" method="diff"/>
27+
<pacflash id="APPIMG" flash="SFL1" blocksize="0x10000" bundleblock="0" method="diff"/>
28+
<!-- The default modem image ID is "PS". It is a SFFS image. -->
29+
<pacsffs id="PS" ebsize="0x10000" pbsize="0x200" mount="/modem" method="diff">
30+
<!--
31+
<file name="nvm/audio_calib.bin" method="ignore"/>
32+
-->
33+
<file name="nvm/bt_config.bin" method="ignore"/>
34+
<file name="nvm/customer.bin" method="ignore"/>
35+
</pacsffs>
36+
<!--
37+
NV will be updated inside modem image. The following are only
38+
describing clear running NV rules.
39+
40+
* always clear running NV:
41+
<cleanrunning onchange="always"/>
42+
* never clear running NV:
43+
<cleanrunning onchange="never"/>
44+
* clear running NV on any listed NV changes:
45+
<cleanrunning onchange="any"/>
46+
* clear running NV when either 0x123 or 0x456 is changed:
47+
<cleanrunning onchange="0x123"/>
48+
<cleanrunning onchange="0x456"/>
49+
-->
50+
<pacnv id="NV">
51+
<nvitem id="0x191" runningnv="/modemnvm/bt_config.bin">
52+
<cleanrunning onchange="never"/>
53+
</nvitem>
54+
<nvitem id="0x1ba" runningnv="/modemnvm/bt_sprd.bin">
55+
<cleanrunning onchange="0x1ba"/>
56+
</nvitem>
57+
<nvitem id="0x259" runningnv="/modemnvm/static_nv.bin">
58+
<cleanrunning onchange="any"/>
59+
</nvitem>
60+
<nvitem id="0x25a" runningnv="/modemnvm/phy_nv.bin">
61+
<cleanrunning onchange="any"/>
62+
</nvitem>
63+
<nvitem id="0x25b" runningnv="/modemnvm/dynamic_nv.bin">
64+
<cleanrunning onchange="any"/>
65+
</nvitem>
66+
<nvitem id="0x25c" runningnv="/modemnvm/static_nv_2.bin">
67+
<cleanrunning onchange="any"/>
68+
</nvitem>
69+
<nvitem id="0x25d" runningnv="/modemnvm/phy_nv_2.bin">
70+
<cleanrunning onchange="any"/>
71+
</nvitem>
72+
<nvitem id="0x25e" runningnv="/modemnvm/dynamic_nv_2.bin">
73+
<cleanrunning onchange="any"/>
74+
</nvitem>
75+
<nvitem id="0x26c" runningnv="/modemnvm/rf_nv.bin">
76+
<cleanrunning onchange="always"/>
77+
</nvitem>
78+
<nvitem id="0x277" runningnv="/modemnvm/cfw_nv.bin">
79+
<cleanrunning onchange="0x277"/>
80+
</nvitem>
81+
<nvitem id="0x278" runningnv="/modemnvm/audio_calib.bin">
82+
<cleanrunning onchange="0x278"/>
83+
</nvitem>
84+
<nvitem id="0x279" runningnv="/modemnvm/phy_nv_catm.bin">
85+
<cleanrunning onchange="any"/>
86+
</nvitem>
87+
<nvitem id="0x27a" runningnv="/modemnvm/audio_codec_nv.bin">
88+
<cleanrunning onchange="0x27a"/>
89+
</nvitem>
90+
<nvitem id="0x27e" runningnv="/modemnvm/customer.bin">
91+
<cleanrunning onchange="never"/>
92+
</nvitem>
93+
</pacnv>
94+
<paccpio id="PREPACK" method="diff">
95+
<!--
96+
<file name="some_file_name" method="ignore"/>
97+
-->
98+
</paccpio>
99+
</pacdiff>

0 commit comments

Comments
 (0)