From c21483f839e5c2080ad1dd0e54572be8698f1546 Mon Sep 17 00:00:00 2001 From: Jiri Gaisler Date: Fri, 30 Jul 2021 11:29:32 +0200 Subject: Added GR740 L2 configuration register --- Makefile.in | 1 - configure | 20 ++++++++++---------- configure.ac | 2 +- gr740.c | 1 + grlib.c | 34 ++++++++++++++++++++++++++++++++++ grlib.h | 3 ++- sis.info | 30 ++++++++++++++++-------------- sis.texi | 2 ++ version.texi | 8 ++++---- 9 files changed, 70 insertions(+), 31 deletions(-) diff --git a/Makefile.in b/Makefile.in index a621756..e4dd40b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -253,7 +253,6 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ -runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ diff --git a/configure b/configure index 34a8e0e..6f42079 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sis 2.27. +# Generated by GNU Autoconf 2.69 for sis 2.28. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -577,8 +577,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sis' PACKAGE_TARNAME='sis' -PACKAGE_VERSION='2.27' -PACKAGE_STRING='sis 2.27' +PACKAGE_VERSION='2.28' +PACKAGE_STRING='sis 2.28' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1283,7 +1283,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sis 2.27 to adapt to many kinds of systems. +\`configure' configures sis 2.28 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1354,7 +1354,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sis 2.27:";; + short | recursive ) echo "Configuration of sis 2.28:";; esac cat <<\_ACEOF @@ -1444,7 +1444,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sis configure 2.27 +sis configure 2.28 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1742,7 +1742,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sis $as_me 2.27, which was +It was created by sis $as_me 2.28, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2569,7 +2569,7 @@ fi # Define the identity of the package. PACKAGE='sis' - VERSION='2.27' + VERSION='2.28' cat >>confdefs.h <<_ACEOF @@ -4911,7 +4911,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sis $as_me 2.27, which was +This file was extended by sis $as_me 2.28, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4977,7 +4977,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sis config.status 2.27 +sis config.status 2.28 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 6396586..362e760 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([sis], [2.27]) +AC_INIT([sis], [2.28]) AC_CONFIG_SRCDIR([sis.c]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_HEADERS(config.h) diff --git a/gr740.c b/gr740.c index 646577e..6e0bafd 100644 --- a/gr740.c +++ b/gr740.c @@ -61,6 +61,7 @@ init_sim (void) grlib_ahbs_add (&apbmst, 0, APBSTART, 0xFFF); grlib_ahbs_add (&sdctrl, 0, RAM_START, RAM_MASKPP); + grlib_ahbs_add (&l2c, 0, 0xF0000000, 0xFFF); grlib_apb_add (&apbuart, 3, APBSTART + 0x00000, 0xFFF); grlib_apb_add (&irqmp, 0, APBSTART + 0x04000, 0xFFF); diff --git a/grlib.c b/grlib.c index aec6234..b26dfc3 100644 --- a/grlib.c +++ b/grlib.c @@ -251,6 +251,40 @@ const struct grlib_ipcore greth = { NULL, NULL, grlib_greth_read, grlib_greth_write, greth_add }; +/* ------------------- L2C -----------------------*/ + +static int +grlib_l2c_read (uint32 addr, uint32 * data) +{ + uint32 res; + + switch (addr & 0xFC) + { + case 4: + /* Status */ + res = 0x00502803; + break; + default: + res = 0; + } + + *data = res; +} + +static void +l2c_add (int irq, uint32 addr, uint32 mask) +{ + grlib_ahbmpp_add (GRLIB_PP_ID (VENDOR_GAISLER, GAISLER_L2C, 0, 0)); + grlib_apbpp_add (GRLIB_PP_ID (VENDOR_GAISLER, GAISLER_L2C, 0, 0), + GRLIB_PP_APBADDR (addr, mask)); + if (sis_verbose) + printf(" Level 2 Cache controller 0x%08x\n", addr); +} + +const struct grlib_ipcore l2c = { + NULL, NULL, grlib_l2c_read, NULL, l2c_add +}; + /* ------------------- LEON3 -----------------------*/ diff --git a/grlib.h b/grlib.h index 235d56a..b182884 100644 --- a/grlib.h +++ b/grlib.h @@ -39,6 +39,7 @@ #define GAISLER_IRQMP 0x00D #define GAISLER_GPTIMER 0x011 #define GAISLER_GRETH 0x01D +#define GAISLER_L2C 0x04B #define ESA_MCTRL 0x00F #define CONTRIB_NS16550 0x050 #define CONTRIB_CLINT 0x051 @@ -104,4 +105,4 @@ extern void apbuart_restore_stdio (void); extern void apbuart_close_port (void); extern void apbuart_flush (void); extern const struct grlib_ipcore gptimer, irqmp, apbuart, apbmst, - greth, leon3s, srctrl, ns16550, clint, plic, sdctrl, s5test; + greth, l2c, leon3s, srctrl, ns16550, clint, plic, sdctrl, s5test; diff --git a/sis.info b/sis.info index 44a5c99..042ce5c 100644 --- a/sis.info +++ b/sis.info @@ -1,6 +1,6 @@ This is sis.info, produced by makeinfo version 6.7 from sis.texi. -This manual is for SIS (version 2.27, 18 December 2020). +This manual is for SIS (version 2.28, 30 July 2021). Copyright (C) 2020 Free Software Foundation, Inc. @@ -21,7 +21,7 @@ File: sis.info, Node: Top, Next: Introduction, Up: (dir) SIS *** -This manual is for SIS (version 2.27, 18 December 2020). +This manual is for SIS (version 2.28, 30 July 2021). * Menu: @@ -649,6 +649,7 @@ The following IP cores from GRLIB are emulated in GR740 mode: IP Core Address Interrupt ------------------------------------------------------- +L2CACHE 0xF0000000 - APBMAST 0xFF900000 - APBUART 0xFF900000 3 IRQMP 0xFF904000 - @@ -664,6 +665,7 @@ Address Type ------------------------------------------------------------------ 0x00000000 - 0x04000000 RAM (64 Mbyte) 0xC0000000 - 0xC1000000 ROM (16 Mbyte) +0xF0000000 - 0xF0100000 L2 cache 0xFF900000 - 0xFFA00000 APB bus 0xFFFFF000 - 0xFFFFFFFF AHB plug&play @@ -1419,18 +1421,18 @@ Index  Tag Table: -Node: Top701 -Node: Introduction1055 -Node: Invoking sis1808 -Node: Commands4368 -Node: Emulated Systems8472 -Node: Multi-processing23069 -Node: Networking23557 -Node: Interfacing to GDB29867 -Node: Code coverage30271 -Node: Building SIS31276 -Node: GNU Free Documentation License31926 -Node: Index57070 +Node: Top697 +Node: Introduction1047 +Node: Invoking sis1800 +Node: Commands4360 +Node: Emulated Systems8464 +Node: Multi-processing23159 +Node: Networking23647 +Node: Interfacing to GDB29957 +Node: Code coverage30361 +Node: Building SIS31366 +Node: GNU Free Documentation License32016 +Node: Index57160  End Tag Table diff --git a/sis.texi b/sis.texi index 4e352c3..0f6a677 100644 --- a/sis.texi +++ b/sis.texi @@ -649,6 +649,7 @@ The following IP cores from GRLIB are emulated in GR740 mode: @multitable {The long name of the core} {Address_long} {Interrupt} @headitem IP Core @tab Address @tab Interrupt +@item L2CACHE @tab 0xF0000000 @tab - @item APBMAST @tab 0xFF900000 @tab - @item APBUART @tab 0xFF900000 @tab 3 @item IRQMP @tab 0xFF904000 @tab - @@ -664,6 +665,7 @@ The following memory areas are valid for GR740: @headitem Address @tab Type @item 0x00000000 - 0x04000000 @tab RAM (64 Mbyte) @item 0xC0000000 - 0xC1000000 @tab ROM (16 Mbyte) +@item 0xF0000000 - 0xF0100000 @tab L2 cache @item 0xFF900000 - 0xFFA00000 @tab APB bus @item 0xFFFFF000 - 0xFFFFFFFF @tab AHB plug&play @end multitable diff --git a/version.texi b/version.texi index 702b422..4db03d6 100644 --- a/version.texi +++ b/version.texi @@ -1,4 +1,4 @@ -@set UPDATED 18 December 2020 -@set UPDATED-MONTH December 2020 -@set EDITION 2.27 -@set VERSION 2.27 +@set UPDATED 30 July 2021 +@set UPDATED-MONTH July 2021 +@set EDITION 2.28 +@set VERSION 2.28 -- cgit v1.2.3