#include <dt-bindings/clock/aspeed-clock.h>
--- #define ASPEED_NUM_CLKS 35
+++ #define ASPEED_NUM_CLKS 36
++
+++#define ASPEED_RESET2_OFFSET 32
+
#define ASPEED_RESET_CTRL 0x04
#define ASPEED_CLK_SELECTION 0x08
#define ASPEED_CLK_STOP_CTRL 0x0c
unsigned long id)
{
struct aspeed_reset *ar = to_aspeed_reset(rcdev);
--- u32 rst = BIT(aspeed_resets[id]);
+++ u32 reg = ASPEED_RESET_CTRL;
+++ u32 bit = aspeed_resets[id];
+
-- return regmap_update_bits(ar->map, ASPEED_RESET_CTRL, rst, 0);
+++ if (bit >= ASPEED_RESET2_OFFSET) {
+++ bit -= ASPEED_RESET2_OFFSET;
+++ reg = ASPEED_RESET_CTRL2;
+++ }
++
- return regmap_update_bits(ar->map, ASPEED_RESET_CTRL, rst, 0);
+++ return regmap_update_bits(ar->map, reg, BIT(bit), 0);
}
static int aspeed_reset_assert(struct reset_controller_dev *rcdev,
unsigned long id)
{
struct aspeed_reset *ar = to_aspeed_reset(rcdev);
--- u32 rst = BIT(aspeed_resets[id]);
+++ u32 reg = ASPEED_RESET_CTRL;
+++ u32 bit = aspeed_resets[id];
++
- return regmap_update_bits(ar->map, ASPEED_RESET_CTRL, rst, rst);
+++ if (bit >= ASPEED_RESET2_OFFSET) {
+++ bit -= ASPEED_RESET2_OFFSET;
+++ reg = ASPEED_RESET_CTRL2;
+++ }
+
-- return regmap_update_bits(ar->map, ASPEED_RESET_CTRL, rst, rst);
+++ return regmap_update_bits(ar->map, reg, BIT(bit), BIT(bit));
}
static int aspeed_reset_status(struct reset_controller_dev *rcdev,