[rtems commit] bsp/altera-cyclone-v: Enable L2 cache for network driver
Sebastian Huber
sebh at rtems.org
Wed May 28 12:55:13 UTC 2014
Module: rtems
Branch: master
Commit: 32c896092579feeee787209deb269f9c66c0081f
Changeset: http://git.rtems.org/rtems/commit/?id=32c896092579feeee787209deb269f9c66c0081f
Author: Ralf Kirchner <ralf.kirchner at embedded-brains.de>
Date: Wed May 28 14:47:03 2014 +0200
bsp/altera-cyclone-v: Enable L2 cache for network driver
---
.../libbsp/arm/altera-cyclone-v/network/network.c | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/c/src/lib/libbsp/arm/altera-cyclone-v/network/network.c b/c/src/lib/libbsp/arm/altera-cyclone-v/network/network.c
index d2f669a..43c95cd 100644
--- a/c/src/lib/libbsp/arm/altera-cyclone-v/network/network.c
+++ b/c/src/lib/libbsp/arm/altera-cyclone-v/network/network.c
@@ -40,6 +40,7 @@
#include <bsp/alt_generalpurpose_io.h>
#include <bsp/nocache-heap.h>
#include "socal/alt_rstmgr.h"
+#include "socal/alt_sysmgr.h"
#include "socal/hps.h"
#include "socal/socal.h"
#include <libchip/dwmac.h>
@@ -1080,9 +1081,21 @@ static int network_if_mem_free_nocache(
*/
static int network_if_bus_setup( void *arg )
{
+ volatile uint32_t reg = alt_read_word( ALT_SYSMGR_EMAC_L3MST_ADDR );
+
(void) arg;
- /* Nothing to be done */
+ reg &= ALT_SYSMGR_EMAC_L3MST_AWCACHE_1_CLR_MSK;
+ reg &= ALT_SYSMGR_EMAC_L3MST_ARCACHE_1_CLR_MSK;
+ reg |= ALT_SYSMGR_EMAC_L3MST_AWCACHE_1_SET(
+ ALT_SYSMGR_EMAC_L3MST_AWCACHE_1_E_CACHE_WRBACK_ALLOC
+ );
+ reg |= ALT_SYSMGR_EMAC_L3MST_ARCACHE_1_SET(
+ ALT_SYSMGR_EMAC_L3MST_ARCACHE_1_E_CACHE_WRBACK_ALLOC
+ );
+
+ alt_write_word( ALT_SYSMGR_EMAC_L3MST_ADDR, reg );
+
return 0;
}
More information about the vc
mailing list