1 // SPDX-License-Identifier: GPL-2.0-only
3 * linux/arch/arm/mach-pxa/pxa2xx.c
5 * code specific to pxa2xx
7 * Copyright (C) 2008 Dmitry Baryshkov
10 #include <linux/module.h>
11 #include <linux/kernel.h>
12 #include <linux/device.h>
15 #include "pxa2xx-regs.h"
16 #include "mfp-pxa25x.h"
20 #include <linux/soc/pxa/smemc.h>
22 void pxa2xx_clear_reset_status(unsigned int mask
)
24 /* RESET_STATUS_* has a 1:1 mapping with RCSR */
28 #define MDCNFG_DRAC2(mdcnfg) (((mdcnfg) >> 21) & 0x3)
29 #define MDCNFG_DRAC0(mdcnfg) (((mdcnfg) >> 5) & 0x3)
31 int pxa2xx_smemc_get_sdram_rows(void)
33 static int sdram_rows
;
34 unsigned int drac2
= 0, drac0
= 0;
40 mdcnfg
= readl_relaxed(MDCNFG
);
42 if (mdcnfg
& (MDCNFG_DE2
| MDCNFG_DE3
))
43 drac2
= MDCNFG_DRAC2(mdcnfg
);
45 if (mdcnfg
& (MDCNFG_DE0
| MDCNFG_DE1
))
46 drac0
= MDCNFG_DRAC0(mdcnfg
);
48 sdram_rows
= 1 << (11 + max(drac0
, drac2
));