From c2676c359c7918df5ddc0b7117ccd9cbc227d4aa Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Fri, 9 Mar 2018 15:40:11 -0800 Subject: [PATCH] Fix CAR primitives --- exosphere/src/car.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/exosphere/src/car.c b/exosphere/src/car.c index 21be03fe6..88a35c9b1 100644 --- a/exosphere/src/car.c +++ b/exosphere/src/car.c @@ -26,8 +26,8 @@ static inline uint32_t get_special_clk_val(CarDevice dev) { } } -static uint32_t g_clk_reg_offsets[NUM_CAR_BANKS] = {0x320, 0x328, 0x330, 0x440, 0x448, 0x284, 0x29C}; -static uint32_t g_rst_reg_offsets[NUM_CAR_BANKS] = {0x300, 0x308, 0x310, 0x430, 0x438, 0x290, 0x2A8}; +static uint32_t g_clk_reg_offsets[NUM_CAR_BANKS] = {0x010, 0x014, 0x018, 0x360, 0x364, 0x280, 0x298}; +static uint32_t g_rst_reg_offsets[NUM_CAR_BANKS] = {0x004, 0x008, 0x00C, 0x358, 0x35C, 0x28C, 0x2A4}; void clk_enable(CarDevice dev) { uint32_t special_reg; @@ -38,7 +38,7 @@ void clk_enable(CarDevice dev) { } void clk_disable(CarDevice dev) { - MAKE_CAR_REG(g_clk_reg_offsets[dev >> 5] + 0x004) |= BIT(dev & 0x1F); + MAKE_CAR_REG(g_clk_reg_offsets[dev >> 5]) &= ~(BIT(dev & 0x1F)); } void rst_enable(CarDevice dev) { @@ -46,7 +46,7 @@ void rst_enable(CarDevice dev) { } void rst_disable(CarDevice dev) { - MAKE_CAR_REG(g_rst_reg_offsets[dev >> 5] + 0x004) |= BIT(dev & 0x1F); + MAKE_CAR_REG(g_rst_reg_offsets[dev >> 5]) &= ~(BIT(dev & 0x1F)); } @@ -62,6 +62,5 @@ void clkrst_disable(CarDevice dev) { void clkrst_reboot(CarDevice dev) { clkrst_disable(dev); - wait(100); clkrst_enable(dev); }