altera_max10: default to UFM flashing

Flashing issues have been resolved. The build system support for
flashing and debugging has been changed back to UFM scenario.
XIP and reset vector no longer disabled. Wiki documentation updated.

Change-Id: Iffe326485c20808dabc1e19e0b18b7b60a83d797
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
diff --git a/boards/altera_max10/altera_max10_defconfig b/boards/altera_max10/altera_max10_defconfig
index 76018db..018cb56 100644
--- a/boards/altera_max10/altera_max10_defconfig
+++ b/boards/altera_max10/altera_max10_defconfig
@@ -6,7 +6,3 @@
 CONFIG_SERIAL=y
 CONFIG_UART_NS16550=y
 CONFIG_UART_CONSOLE=y
-
-# FIXME ZEP-273
-CONFIG_XIP=n
-CONFIG_INCLUDE_RESET_VECTOR=n
diff --git a/scripts/support/nios2.sh b/scripts/support/nios2.sh
index 2981345..1c3ff5b 100755
--- a/scripts/support/nios2.sh
+++ b/scripts/support/nios2.sh
@@ -17,7 +17,7 @@
     GDB_TCP_PORT=
 done
 
-REQUIRED_PROGRAMS="nios2-gdb-server nios2-download"
+REQUIRED_PROGRAMS="quartus_cpf quartus_pgm nios2-gdb-server nios2-download"
 
 
 for pgm in ${REQUIRED_PROGRAMS}; do
@@ -29,14 +29,21 @@
 # CONFIG_INCLUDE_RESET_VECTOR must be disabled.
 
 do_flash() {
-    nios2-download --go ${ELF_NAME}
+    if [ -z "${NIOS2_CPU_SOF}" ]; then
+        echo "Please set NIOS2_CPU_SOF variable to location of CPU .sof data"
+        exit 1
+    fi
+
+    ${ZEPHYR_BASE}/scripts/support/quartus-flash.py \
+            --sof ${NIOS2_CPU_SOF} \
+            --kernel ${HEX_NAME}
 }
 
 do_debug() {
     do_debugserver 1 &
 
     # connect to the GDB server
-    ${GDB} ${TUI} -ex "target remote :${GDB_TCP_PORT}" -ex "load" ${ELF_NAME}
+    ${GDB} ${TUI} ${ELF_NAME} -ex "target remote :${GDB_TCP_PORT}"
 }
 
 do_debugserver() {
@@ -49,7 +56,7 @@
         SETSID=
     fi
     echo "Nios II GDB server running on port ${GDB_TCP_PORT}"
-    ${SETSID} nios2-gdb-server --tcpport ${GDB_TCP_PORT} --init-cache --reset-target
+    ${SETSID} nios2-gdb-server --tcpport ${GDB_TCP_PORT} --stop --reset-target
 }