Added Highmem Variant of Kelvin Core for DV

Additional memory required for DV. Specifically generated instructions
using synopsys STING requires at least 256Kbytes imem. More is better.

Increasing both itcm and dtcm to 1MB.

Change-Id: I0671f4c3e9a8518116e6cd4f6003de83fa6ca742
diff --git a/BUILD b/BUILD
index 4ed9d4a..fb944a2 100644
--- a/BUILD
+++ b/BUILD
@@ -18,9 +18,21 @@
     build_setting_default = False,
 )
 
+bool_flag(
+    name = "link_tcm_highmem",
+    build_setting_default = False,
+)
+
 config_setting(
     name = "link_tcm_config",
     flag_values = {
         ":link_tcm": "True",
     },
-)
\ No newline at end of file
+)
+
+config_setting(
+    name = "link_tcm_highmem_config",
+    flag_values = {
+        ":link_tcm_highmem": "True",
+    },
+)
diff --git a/crt/BUILD b/crt/BUILD
index a0c26d5..85c25ab 100644
--- a/crt/BUILD
+++ b/crt/BUILD
@@ -17,6 +17,7 @@
 filegroup(
     name = "kelvin_linker",
     srcs = select({
+        "//:link_tcm_highmem_config": ["kelvin_tcm_highmem.ld"],
         "//:link_tcm_config": ["kelvin_tcm.ld"],
         "//conditions:default": ["kelvin.ld"],
     }),
diff --git a/crt/kelvin_tcm_highmem.ld b/crt/kelvin_tcm_highmem.ld
new file mode 100644
index 0000000..dc46060
--- /dev/null
+++ b/crt/kelvin_tcm_highmem.ld
@@ -0,0 +1,88 @@
+/* Copyright 2024 Google LLC. */
+/* Licensed under the Apache License, Version 2.0, see LICENSE for details. */
+/* SPDX-License-Identifier: Apache-2.0 */
+
+MEMORY {
+    ITCM(rx): ORIGIN = 0x00000000, LENGTH = 1024K
+    DTCM(rw): ORIGIN = 0x00100000, LENGTH = 1024K
+}
+
+STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x1000;
+HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x1000;
+
+ENTRY(_start)
+
+SECTIONS {
+    /* ITCM data here */
+    . = ORIGIN(ITCM);
+    .text : ALIGN(16) {
+        *(._init)
+        *(.text)
+        *(.text.*)
+        . = ALIGN(16);
+    } > ITCM
+
+    .init.array : ALIGN(16) {
+      __init_array_start = .;
+      __init_array_start__ = .;
+      *(.init_array)
+      *(.init_array.*)
+      . = ALIGN(16);
+      __init_array_end = .;
+      __init_array_end__ = .;
+    } > ITCM
+
+    .rodata : ALIGN(16) {
+      *(.srodata)
+      *(.srodata.*)
+      *(.rodata)
+      *(.rodata.*)
+      . = ALIGN(16);
+    } > ITCM
+
+    .data : ALIGN(16) {
+      __data_start__ = .;
+      /**
+      * This will get loaded into `gp`, and the linker will use that register for
+      * accessing data within [-2048,2047] of `__global_pointer$`.
+      *
+      * This is much cheaper (for small data) than materializing the
+      * address and loading from that (which will take one extra instruction).
+      */
+      _global_pointer = . + 0x800;
+      *(.sdata)
+      *(.sdata.*)
+      *(.data)
+      *(.data.*)
+      /**
+       * Memory location for the return value from main,
+       * which could be inspected by another core in the system.
+       **/
+      _ret = .;
+      . = ALIGN(16);
+        __data_end__ = .;
+    } > DTCM
+
+    /* DTCM data here */
+    . = ORIGIN(DTCM);
+    .bss : ALIGN(16) {
+      __bss_start__ = .;
+      *(.sbss)
+      *(.sbss.*)
+      *(.bss)
+      *(.bss.*)
+      __bss_end__ = .;
+    } > DTCM
+
+    .heap : ALIGN(16) {
+      __heap_start__ = .;
+      . += HEAP_SIZE;
+      __heap_end__ = .;
+    } > DTCM
+
+    .stack : ALIGN(16) {
+      __stack_start__ = .;
+      . += STACK_SIZE;
+      __stack_end__ = .;
+    } > DTCM
+}
\ No newline at end of file