[rtems commit] U-Boot: Flush data cache after bdinfo copy

Sebastian Huber sebh at rtems.org
Thu Mar 3 08:12:34 UTC 2016


Module:    rtems
Branch:    master
Commit:    e468ba5532232e2ea7bac6b0f5787e0a49008a53
Changeset: http://git.rtems.org/rtems/commit/?id=e468ba5532232e2ea7bac6b0f5787e0a49008a53

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Mar  3 09:08:08 2016 +0100

U-Boot: Flush data cache after bdinfo copy

---

 .../lib/libbsp/powerpc/qoriq/include/u-boot-config.h  |  2 --
 c/src/lib/libbsp/shared/src/bsp-uboot-board-info.c    | 19 +++++++------------
 2 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/c/src/lib/libbsp/powerpc/qoriq/include/u-boot-config.h b/c/src/lib/libbsp/powerpc/qoriq/include/u-boot-config.h
index 3e6fa90..7f9ed73 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/include/u-boot-config.h
+++ b/c/src/lib/libbsp/powerpc/qoriq/include/u-boot-config.h
@@ -17,8 +17,6 @@
 
 #include <bspopts.h>
 
-#define U_BOOT_BOARD_INFO_TEXT_SECTION __attribute__((section(".bsp_start_text")))
-
 #define U_BOOT_BOARD_INFO_DATA_SECTION __attribute__((section(".bsp_start_data")))
 
 #define CONFIG_E500
diff --git a/c/src/lib/libbsp/shared/src/bsp-uboot-board-info.c b/c/src/lib/libbsp/shared/src/bsp-uboot-board-info.c
index 10a99c2..e68060a 100644
--- a/c/src/lib/libbsp/shared/src/bsp-uboot-board-info.c
+++ b/c/src/lib/libbsp/shared/src/bsp-uboot-board-info.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2014 embedded brains GmbH.  All rights reserved.
+ * Copyright (c) 2010, 2016 embedded brains GmbH.  All rights reserved.
  *
  *  embedded brains GmbH
  *  Dornierstr. 4
@@ -14,9 +14,8 @@
 
 #include <bsp/u-boot.h>
 
-#ifndef U_BOOT_BOARD_INFO_TEXT_SECTION
-#define U_BOOT_BOARD_INFO_TEXT_SECTION
-#endif
+#include <string.h>
+#include <rtems.h>
 
 #ifndef U_BOOT_BOARD_INFO_DATA_SECTION
 #define U_BOOT_BOARD_INFO_DATA_SECTION
@@ -24,14 +23,10 @@
 
 U_BOOT_BOARD_INFO_DATA_SECTION bd_t bsp_uboot_board_info;
 
-U_BOOT_BOARD_INFO_TEXT_SECTION void bsp_uboot_copy_board_info(const bd_t *src)
+void bsp_uboot_copy_board_info(const bd_t *src)
 {
-  const int *s = (const int *) src;
-  int *d = (int *) &bsp_uboot_board_info;
-  int i = 0;
-  int n = sizeof(*src) / sizeof(int);
+  bd_t *dst = &bsp_uboot_board_info;
 
-  for (i = 0; i < n; ++i) {
-    d [i] = s [i];
-  }
+  dst = memcpy(dst, src, sizeof(*dst));
+  rtems_cache_flush_multiple_data_lines(dst, sizeof(*dst));
 }



More information about the vc mailing list