WindCore/series7/gpio_controller.cpp
WindCore/series7/lcd_controller.cpp
WindCore/series7/os_timer.cpp
+ WindCore/series7/reset_controller.cpp
WindCore/series7/sa1100.cpp
WindCore/series7/sa1100_memory.cpp
)
--- /dev/null
+// ARMware - an ARM emulator
+// Copyright (C) <2007> Wei Hu <wei.hu.tw@gmail.com>
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+
+#include "reset_controller.h"
+
+#include "logger.h"
+
+namespace SA1100 {
+
+uint32_t ResetController::read32(const uint32_t address) const {
+ switch (address) {
+ case RSRR:
+ LOG_REG_R("ResetController RSRR", address, 0);
+ // :SA-1110 Developer's Manual: Wei 2003-Dec-11:
+ //
+ // RSRR is write-only.
+ return 0;
+
+ case RCSR: {
+ LOG_REG_R("ResetController RCSR", address, mRCSR);
+ return mRCSR;
+ }
+
+ default:
+ LOG_REG_R("ResetController Unknown", address, 0);
+ return 0;
+ }
+}
+
+void ResetController::write32(const uint32_t address, const uint32_t value) {
+ switch (address) {
+ case RSRR:
+ LOG_REG_W("ResetController RSRR", address, value);
+ mRSRR = value;
+ break;
+
+ case RCSR:
+ LOG_REG_W("ResetController RCSR", address, value);
+ mRCSR = value;
+ break;
+
+ default:
+ LOG_REG_W("ResetController Unknown", address, value);
+ break;
+ }
+}
+
+} // namespace SA1100
--- /dev/null
+// ARMware - an ARM emulator
+// Copyright (C) <2007> Wei Hu <wei.hu.tw@gmail.com>
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+
+#ifndef RESET_CONTROLLER_H
+#define RESET_CONTROLLER_H
+
+#include <cstdint>
+
+namespace SA1100 {
+
+class ResetController {
+public:
+ ResetController() { initRegisters(); }
+
+ void reset() {
+ mRSRR = 0;
+ mRCSR = 2;
+ }
+
+ bool resetRequested() { return mRSRR & 0xFFFFFFFF; }
+
+ uint32_t read32(const uint32_t address) const;
+ void write32(const uint32_t address, const uint32_t value);
+
+private:
+ enum { RSRR = 0x90030000, RCSR = 0x90030004 };
+
+ uint32_t mRSRR; // Reset controller software reset register
+ uint32_t mRCSR; // Reset controller status register
+
+ void initRegisters() {
+ mRSRR = 0;
+ mRCSR = 1;
+ }
+};
+
+} // namespace SA1100
+
+#endif // RESET_CONTROLLER_H