]> rtime.felk.cvut.cz Git - sysless.git/commitdiff
The shadow registers definition moved to separate file bsp0common.c.
authorPavel Pisa <pisa@cmp.felk.cvut.cz>
Sun, 30 Oct 2005 17:46:00 +0000 (17:46 +0000)
committerPavel Pisa <pisa@cmp.felk.cvut.cz>
Sun, 30 Oct 2005 17:46:00 +0000 (17:46 +0000)
This file is included in all link variants and section is placed
to the same target address => application can modify even registers,
which values are set only by boot loader. The hwinit.c code should
ensure, that defined initial value is stored into each shadow and register,
because shadow store is not touched by crt0.o and contains garbage
after reset.

darcs-hash:20051030174654-ff715-805cf1ba9deb6759bbc7c1fa2261fcd976d6a3b0.gz

20 files changed:
board/edk2638/libs/edk2638.ld-bload
board/edk2638/libs/edk2638.ld-boot
board/edk2638/libs/edk2638.ld-flash
board/edk2638/libs/edk2638.ld-ram
board/edk2638/libs/hwinit/Makefile.omk
board/edk2638/libs/hwinit/bsp0common.c [new file with mode: 0644]
board/edk2638/libs/hwinit/hwinit.c
board/h8canusb/libs/h8canusb.ld-bload
board/h8canusb/libs/h8canusb.ld-boot
board/h8canusb/libs/h8canusb.ld-flash
board/h8canusb/libs/h8canusb.ld-flashnoram
board/h8canusb/libs/h8canusb.ld-ram
board/h8canusb/libs/hwinit/bsp0common.c [new file with mode: 0644]
board/h8mirosot/libs/h8canusb.ld-bload
board/h8mirosot/libs/h8canusb.ld-boot
board/h8mirosot/libs/h8canusb.ld-flash
board/h8mirosot/libs/h8canusb.ld-ram
board/h8mirosot/libs/hwinit/Makefile.omk
board/h8mirosot/libs/hwinit/bsp0common.c [new file with mode: 0644]
board/h8mirosot/libs/hwinit/hwinit.c

index 7d1a98bd9d28c3416fc269d1793a375b1b235939..6ad8f2f4644f4e68d77ae3eb004090bed5bf5d60 100644 (file)
@@ -4,6 +4,8 @@ INCLUDE "edk2638.ld-cfg"
 
 PROVIDE( ___stack_top = ( __iram0_end & ~ 3 ) - 4 );
 
+INPUT(bsp0common.o)
+
 SECTIONS
 {
         .text :
index aeae1dd65334cffa53e80829468be62407f4bead..2ad8659cc7daee6f20d39808a53be4bc76e52c53 100644 (file)
@@ -6,6 +6,7 @@ PROVIDE( ___stack_top = ( __iram0_end & ~ 3 ) - 4 );
 /*PROVIDE( ___setup_board = _start);*/
 
 STARTUP(crt0.o)
+INPUT(bsp0common.o)
 INPUT(hwinit.o setup_board.o)
 
 SECTIONS
index 0c73931009d22ca7064a5f29302e84080841d3cd..232b565d1d08d26b58d7e53c6c872d7989f984c4 100644 (file)
@@ -8,6 +8,7 @@ PROVIDE( ___stack_top = ( __iram0_end & ~ 3 ) - 4 );
 PROVIDE( ___heap_end = __ram_end );
 
 STARTUP(crt0.o)
+INPUT(bsp0common.o)
 
 SECTIONS
 {
index 561a1d37528f2d4638f75704f4f4f22776af580b..96e9f0befca2740e401d7a96d6a8f1dc4d05190c 100644 (file)
@@ -10,6 +10,7 @@ PROVIDE( ___stack_top = ( __iram0_end & ~ 3 ) - 4 );
 PROVIDE( ___heap_end = __ram_end );
 
 STARTUP(crt0.o)
+INPUT(bsp0common.o)
 
 SECTIONS
 {
index 8528bbf5d42a532eab87bbbeb3a1b55781133853..fac4950f7f41a4bbb0504d259111fd0f6dac6f62 100644 (file)
@@ -4,4 +4,4 @@ lib_LIBRARIES = hwinit
 
 hwinit_SOURCES = hwinit.c setup_board.S
 
-lib_obj_SOURCES = hwinit.c setup_board.S
+lib_obj_SOURCES = bsp0common.c hwinit.c setup_board.S
diff --git a/board/edk2638/libs/hwinit/bsp0common.c b/board/edk2638/libs/hwinit/bsp0common.c
new file mode 100644 (file)
index 0000000..b18ae5b
--- /dev/null
@@ -0,0 +1,12 @@
+/* procesor H8S/2638 ver 1.1  */
+#include <types.h>
+#include <cpu_def.h>
+#include <h8s2638h.h>
+#include <system_def.h>
+
+#define SHADOW_SECT __attribute((section (".shadreg")))
+
+__u8 DIO_P1DDR_shadow SHADOW_SECT;
+__u8 DIO_P3DDR_shadow SHADOW_SECT;
+__u8 DIO_PFDDR_shadow SHADOW_SECT;
+__u8 DIO_PJDDR_shadow SHADOW_SECT;
index 1e88989919540815dcfd1ea6404019686ce76c3f..f36200745233cdedfba1813bb4bff92b691ade59 100644 (file)
 #endif /*XRAM_SUPPORT_ENABLED*/
 #define SMALL_ADRBUS 8
 
-#define SHADOW_SECT __attribute((section (".shadreg")))
-
-__u8 DIO_P1DDR_shadow SHADOW_SECT;
-__u8 DIO_P3DDR_shadow SHADOW_SECT;
-__u8 DIO_PFDDR_shadow SHADOW_SECT;
-__u8 DIO_PJDDR_shadow SHADOW_SECT;
-
 static void deb_led_out(char val)
 {
  #if 0
index 940dbae076e42aca732ad52db67bfced5de2c17f..3dddd4b10d4218b84d5875f41eae1b722262892e 100644 (file)
@@ -4,6 +4,8 @@ INCLUDE "h8canusb.ld-cfg"
 
 PROVIDE( ___stack_top = ( __iram0_end & ~ 3 ) - 4 );
 
+INPUT(bsp0common.o)
+
 SECTIONS
 {
         .text :
index 8305bc485a6e3dc99a24c23cc8268bcd58040ea6..7e60be090de735a562c333b7cedd7b2d10d1e68e 100644 (file)
@@ -6,6 +6,7 @@ PROVIDE( ___stack_top = ( __iram0_end & ~ 3 ) - 4 );
 /*PROVIDE( ___setup_board = _start);*/
 
 STARTUP(crt0.o)
+INPUT(bsp0common.o)
 INPUT(hwinit.o setup_board.o)
 
 SECTIONS
index 5ced3710305e20e0535f7cd139980494519d1883..c65b15c9b8c369fe40e6a7d9ae4ddd0b9824d5f0 100644 (file)
@@ -8,6 +8,7 @@ PROVIDE( ___stack_top = ( __iram0_end & ~ 3 ) - 4 );
 PROVIDE( ___heap_end = __ram_end );
 
 STARTUP(crt0.o)
+INPUT(bsp0common.o)
 
 SECTIONS
 {
index 02747032c481c10aeee308c40ce19af627b4660e..15d522e1344f449385654243e7355b371fcf027d 100644 (file)
@@ -9,6 +9,7 @@ PROVIDE( ___stack_top = ( __iram0_end & ~ 3 ) - 4 );
 PROVIDE( ___heap_end = __iram0_end - 0x200 );
 
 STARTUP(crt0.o)
+INPUT(bsp0common.o)
 
 SECTIONS
 {
index c0a9d7cfcb8db9d8b2211fc4962a33c79a144e2a..6632387fb9ac8796e7342e87ff895742afe04c01 100644 (file)
@@ -10,6 +10,7 @@ PROVIDE( ___stack_top = ( __iram0_end & ~ 3 ) - 4 );
 PROVIDE( ___heap_end = __ram_end );
 
 STARTUP(crt0.o)
+INPUT(bsp0common.o)
 
 SECTIONS
 {
diff --git a/board/h8canusb/libs/hwinit/bsp0common.c b/board/h8canusb/libs/hwinit/bsp0common.c
new file mode 100644 (file)
index 0000000..b18ae5b
--- /dev/null
@@ -0,0 +1,12 @@
+/* procesor H8S/2638 ver 1.1  */
+#include <types.h>
+#include <cpu_def.h>
+#include <h8s2638h.h>
+#include <system_def.h>
+
+#define SHADOW_SECT __attribute((section (".shadreg")))
+
+__u8 DIO_P1DDR_shadow SHADOW_SECT;
+__u8 DIO_P3DDR_shadow SHADOW_SECT;
+__u8 DIO_PFDDR_shadow SHADOW_SECT;
+__u8 DIO_PJDDR_shadow SHADOW_SECT;
index 940dbae076e42aca732ad52db67bfced5de2c17f..3dddd4b10d4218b84d5875f41eae1b722262892e 100644 (file)
@@ -4,6 +4,8 @@ INCLUDE "h8canusb.ld-cfg"
 
 PROVIDE( ___stack_top = ( __iram0_end & ~ 3 ) - 4 );
 
+INPUT(bsp0common.o)
+
 SECTIONS
 {
         .text :
index 83b569f07fd4f85fe3f0a24bad1e42631b0cdbff..7db74cef88001d5e89b3ff5d6375b98f69dd63ad 100644 (file)
@@ -6,6 +6,7 @@ PROVIDE( ___stack_top = ( __iram0_end & ~ 3 ) - 4 );
 /*PROVIDE( ___setup_board = _start);*/
 
 STARTUP(crt0.o)
+INPUT(bsp0common.o)
 INPUT(hwinit.o setup_board.o)
 
 SECTIONS
index 02747032c481c10aeee308c40ce19af627b4660e..15d522e1344f449385654243e7355b371fcf027d 100644 (file)
@@ -9,6 +9,7 @@ PROVIDE( ___stack_top = ( __iram0_end & ~ 3 ) - 4 );
 PROVIDE( ___heap_end = __iram0_end - 0x200 );
 
 STARTUP(crt0.o)
+INPUT(bsp0common.o)
 
 SECTIONS
 {
index c0a9d7cfcb8db9d8b2211fc4962a33c79a144e2a..6632387fb9ac8796e7342e87ff895742afe04c01 100644 (file)
@@ -10,6 +10,7 @@ PROVIDE( ___stack_top = ( __iram0_end & ~ 3 ) - 4 );
 PROVIDE( ___heap_end = __ram_end );
 
 STARTUP(crt0.o)
+INPUT(bsp0common.o)
 
 SECTIONS
 {
index 8528bbf5d42a532eab87bbbeb3a1b55781133853..fac4950f7f41a4bbb0504d259111fd0f6dac6f62 100644 (file)
@@ -4,4 +4,4 @@ lib_LIBRARIES = hwinit
 
 hwinit_SOURCES = hwinit.c setup_board.S
 
-lib_obj_SOURCES = hwinit.c setup_board.S
+lib_obj_SOURCES = bsp0common.c hwinit.c setup_board.S
diff --git a/board/h8mirosot/libs/hwinit/bsp0common.c b/board/h8mirosot/libs/hwinit/bsp0common.c
new file mode 100644 (file)
index 0000000..b18ae5b
--- /dev/null
@@ -0,0 +1,12 @@
+/* procesor H8S/2638 ver 1.1  */
+#include <types.h>
+#include <cpu_def.h>
+#include <h8s2638h.h>
+#include <system_def.h>
+
+#define SHADOW_SECT __attribute((section (".shadreg")))
+
+__u8 DIO_P1DDR_shadow SHADOW_SECT;
+__u8 DIO_P3DDR_shadow SHADOW_SECT;
+__u8 DIO_PFDDR_shadow SHADOW_SECT;
+__u8 DIO_PJDDR_shadow SHADOW_SECT;
index 70de50d8e86e98f7b7d3703a12d448a141024562..ecb2de079b5fe9fb81533e18f78b1384c49033fe 100644 (file)
 #endif /*XRAM_SUPPORT_ENABLED*/
 #define SMALL_ADRBUS 8
 
-#define SHADOW_SECT __attribute((section (".shadreg")))
-
-__u8 DIO_P1DDR_shadow SHADOW_SECT;
-__u8 DIO_P3DDR_shadow SHADOW_SECT;
-__u8 DIO_PFDDR_shadow SHADOW_SECT;
-__u8 DIO_PJDDR_shadow SHADOW_SECT;
-
 static void deb_led_out(char val)
 {
   if (val&1)