memory: Further cleanups
Subsystems (11)
Krzysztof Kozlowski
maintainercover memory: Further cleanups
Hi,
I have few other cleanups which I could take. Two patches need here testing as they are not trivial.
Best regards,
Krzysztof
Krzysztof Kozlowski
maintainerPATCH 1/16 memory: bt1-l2-ctl: Add blank lines after declarations
Add blank lines to improve code readability. No functional change.
--- drivers/memory/bt1-l2-ctl.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/memory/bt1-l2-ctl.c +2 -0
@@ -66,6 +66,7 @@ struct l2_ctl_device_attribute {struct device_attribute dev_attr;enum l2_ctl_stall id; }; +#define to_l2_ctl_dev_attr (_dev_attr) \ container_of(_dev_attr, struct l2_ctl_device_attribute, dev_attr)
@@ -242,6 +243,7 @@ static ssize_t l2_ctl_latency_store(struct device *dev,return count; } + static L2_CTL_ATTR_RW(l2_ws_latency, l2_ctl_latency, L2_WS_STALL); static L2_CTL_ATTR_RW(l2_tag_latency, l2_ctl_latency, L2_TAG_STALL); static L2_CTL_ATTR_RW(l2_data_latency, l2_ctl_latency, L2_DATA_STALL);
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH 2/16 memory: mvebu-devbus: Add missing braces to all arms of if statement
In reply to Krzysztof KozlowskiAdd missing braces to all arms of if statement to align with coding convention.
--- drivers/memory/mvebu-devbus.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/memory/mvebu-devbus.c +3 -3
@@ -124,11 +124,11 @@ static int devbus_get_timing_params(struct devbus *devbus,* The bus width is encoded into the register as 0 for 8 bits, * and 1 for 16 bits, so we do the necessary conversion here. */ -if (r->bus_width ==8 ) +if (r->bus_width ==8 ) { r->bus_width =0 ; -else if (r->bus_width ==16 ) + }else if (r->bus_width ==16 ) { r->bus_width =1 ; -else { + }else {dev_err (devbus->dev,"invalid bus width %d\n" , r->bus_width);return -EINVAL ; }
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH 3/16 memory: mvebu-devbus: Align with open parenthesis
In reply to Krzysztof KozlowskiThe line continuation contained spaces but still failed to properly align with open parenthesis.
--- drivers/memory/mvebu-devbus.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/memory/mvebu-devbus.c +7 -7
@@ -134,22 +134,22 @@ static int devbus_get_timing_params(struct devbus *devbus, } err =get_timing_param_ps (devbus, node,"devbus,badr-skew-ps" , - &r->badr_skew); + &r->badr_skew);if (err <0 )return err; err =get_timing_param_ps (devbus, node,"devbus,turn-off-ps" , - &r->turn_off); + &r->turn_off);if (err <0 )return err; err =get_timing_param_ps (devbus, node,"devbus,acc-first-ps" , - &r->acc_first); + &r->acc_first);if (err <0 )return err; err =get_timing_param_ps (devbus, node,"devbus,acc-next-ps" , - &r->acc_next); + &r->acc_next);if (err <0 )return err;
@@ -175,17 +175,17 @@ static int devbus_get_timing_params(struct devbus *devbus, } err =get_timing_param_ps (devbus, node,"devbus,ale-wr-ps" , - &w->ale_wr); + &w->ale_wr);if (err <0 )return err; err =get_timing_param_ps (devbus, node,"devbus,wr-low-ps" , - &w->wr_low); + &w->wr_low);if (err <0 )return err; err =get_timing_param_ps (devbus, node,"devbus,wr-high-ps" , - &w->wr_high); + &w->wr_high);if (err <0 )return err;
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH 4/16 memory: omap-gpmc: Correct kerneldoc
In reply to Krzysztof KozlowskiUse proper kerneldoc to fix GCC warnings like:
drivers/memory/omap-gpmc.c:299: warning: Function parameter or member 'cs' not described in 'gpmc_get_clk_period' drivers/memory/omap-gpmc.c:432: warning: Excess function parameter 'ma' description in 'get_gpmc_timing_reg'
--- drivers/memory/omap-gpmc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/memory/omap-gpmc.c +4 -4
@@ -289,8 +289,8 @@ static unsigned long gpmc_get_fclk_period(void)/** * gpmc_get_clk_period - get period of selected clock domain in ps -* @cs Chip Select Region. -* @cd Clock Domain. +* @cs: Chip Select Region. +* @cd: Clock Domain. * * GPMC_CS_CONFIG1 GPMCFCLKDIVIDER for cs has to be setup * prior to calling this function with GPMC_CD_CLK.
@@ -409,7 +409,7 @@ static void gpmc_cs_bool_timings(int cs, const struct gpmc_bool_timings *p)* @reg: GPMC_CS_CONFIGn register offset. * @st_bit: Start Bit * @end_bit: End Bit. Must be >= @st_bit. -* @ma:x Maximum parameter value (before optional @shift). +* @max: Maximum parameter value (before optional @shift). * If 0, maximum is as high as @st_bit and @end_bit allow. * @name: DTS node name, w/o "gpmc," * @cd: Clock Domain of timing parameter.
@@ -1134,7 +1134,7 @@ static struct gpmc_nand_ops nand_ops = {/** * gpmc_omap_get_nand_ops - Get the GPMC NAND interface -* @regs: the GPMC NAND register map exclusive for NAND use. +* @reg: the GPMC NAND register map exclusive for NAND use. * @cs: GPMC chip select number on which the NAND sits. The * register map returned will be specific to this chip select. *
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH 5/16 memory: omap-gpmc: Enclose macro argument usage in parenthesis
In reply to Krzysztof KozlowskiMacros arguments should be enclosed by parenthesis for safety.
--- drivers/memory/omap-gpmc.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/memory/omap-gpmc.c +10 -10
@@ -107,8 +107,8 @@#define ENABLE_PREFETCH (0x1 << 7)#define DMA_MPU_MODE 2 -#define GPMC_REVISION_MAJOR (l) ((l >> 4) & 0xf) -#define GPMC_REVISION_MINOR (l) (l & 0xf) +#define GPMC_REVISION_MAJOR (l) (((l) >> 4) & 0xf) +#define GPMC_REVISION_MINOR (l) ((l) & 0xf)#define GPMC_HAS_WR_ACCESS 0x1#define GPMC_HAS_WR_DATA_MUX_BUS 0x2
@@ -139,27 +139,27 @@#define GPMC_CONFIG1_WRITEMULTIPLE_SUPP (1 << 28)#define GPMC_CONFIG1_WRITETYPE_ASYNC (0 << 27)#define GPMC_CONFIG1_WRITETYPE_SYNC (1 << 27) -#define GPMC_CONFIG1_CLKACTIVATIONTIME (val) ((val & 3) << 25) +#define GPMC_CONFIG1_CLKACTIVATIONTIME (val) (((val) & 3) << 25)/** CLKACTIVATIONTIME Max Ticks */ #define GPMC_CONFIG1_CLKACTIVATIONTIME_MAX 2 -#define GPMC_CONFIG1_PAGE_LEN (val) ((val & 3) << 23) +#define GPMC_CONFIG1_PAGE_LEN (val) (((val) & 3) << 23)/** ATTACHEDDEVICEPAGELENGTH Max Value */ #define GPMC_CONFIG1_ATTACHEDDEVICEPAGELENGTH_MAX 2#define GPMC_CONFIG1_WAIT_READ_MON (1 << 22)#define GPMC_CONFIG1_WAIT_WRITE_MON (1 << 21) -#define GPMC_CONFIG1_WAIT_MON_TIME (val) ((val & 3) << 18) +#define GPMC_CONFIG1_WAIT_MON_TIME (val) (((val) & 3) << 18)/** WAITMONITORINGTIME Max Ticks */ #define GPMC_CONFIG1_WAITMONITORINGTIME_MAX 2 -#define GPMC_CONFIG1_WAIT_PIN_SEL (val) ((val & 3) << 16) -#define GPMC_CONFIG1_DEVICESIZE (val) ((val & 3) << 12) +#define GPMC_CONFIG1_WAIT_PIN_SEL (val) (((val) & 3) << 16) +#define GPMC_CONFIG1_DEVICESIZE (val) (((val) & 3) << 12)#define GPMC_CONFIG1_DEVICESIZE_16 GPMC_CONFIG1_DEVICESIZE(1)/** DEVICESIZE Max Value */ #define GPMC_CONFIG1_DEVICESIZE_MAX 1 -#define GPMC_CONFIG1_DEVICETYPE (val) ((val & 3) << 10) +#define GPMC_CONFIG1_DEVICETYPE (val) (((val) & 3) << 10)#define GPMC_CONFIG1_DEVICETYPE_NOR GPMC_CONFIG1_DEVICETYPE(0) -#define GPMC_CONFIG1_MUXTYPE (val) ((val & 3) << 8) +#define GPMC_CONFIG1_MUXTYPE (val) (((val) & 3) << 8)#define GPMC_CONFIG1_TIME_PARA_GRAN (1 << 4) -#define GPMC_CONFIG1_FCLK_DIV (val) (val & 3) +#define GPMC_CONFIG1_FCLK_DIV (val) ((val) & 3)#define GPMC_CONFIG1_FCLK_DIV2 (GPMC_CONFIG1_FCLK_DIV(1))#define GPMC_CONFIG1_FCLK_DIV3 (GPMC_CONFIG1_FCLK_DIV(2))#define GPMC_CONFIG1_FCLK_DIV4 (GPMC_CONFIG1_FCLK_DIV(3))
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH 6/16 memory: omap-gpmc: Use 'unsigned int' for consistency
In reply to Krzysztof KozlowskiDriver uses 'unsigned int' in other places instead of 'unsigned'.
--- drivers/memory/omap-gpmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/memory/omap-gpmc.c +2 -2
@@ -243,7 +243,7 @@ static DEFINE_SPINLOCK(gpmc_mem_lock);/* Define chip-selects as reserved by default until probe completes */ static unsigned int gpmc_cs_num =GPMC_CS_NUM ;static unsigned int gpmc_nr_waitpins; -static unsigned gpmc_capability; +static unsigned int gpmc_capability;static void __iomem *gpmc_base;static struct clk *gpmc_l3_clk;
@@ -1289,7 +1289,7 @@ int gpmc_omap_onenand_set_timings(struct device *dev, int cs, int freq, }EXPORT_SYMBOL_GPL (gpmc_omap_onenand_set_timings); -int gpmc_get_client_irq (unsigned irq_config) +int gpmc_get_client_irq (unsigned int irq_config) {if (!gpmc_irq_domain) { pr_warn("%s called before GPMC IRQ domain available\n",
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH 7/16 memory: omap-gpmc: Correct white space issues
In reply to Krzysztof KozlowskiRemove some unneeded blank lines, align indentation with open parenthesis (or fix existing alignment).
--- drivers/memory/omap-gpmc.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-)
drivers/memory/omap-gpmc.c +7 -17
@@ -297,7 +297,6 @@ static unsigned long gpmc_get_fclk_period(void)*/ static unsigned long gpmc_get_clk_period (int cs,enum gpmc_clk_domain cd) { -unsigned long tick_ps =gpmc_get_fclk_period ();u32 l;int div;
@@ -317,7 +316,6 @@ static unsigned long gpmc_get_clk_period(int cs, enum gpmc_clk_domain cd) }return tick_ps; - } static unsigned int gpmc_ns_to_clk_ticks(unsigned int time_ns, int cs,
@@ -509,7 +507,7 @@ static void gpmc_cs_show_timings(int cs, const char *desc)GPMC_GET_RAW_BOOL (GPMC_CS_CONFIG1 ,4 ,4 ,"time-para-granularity" );GPMC_GET_RAW (GPMC_CS_CONFIG1 ,8 ,9 ,"mux-add-data" );GPMC_GET_RAW_SHIFT_MAX (GPMC_CS_CONFIG1 ,12 ,13 ,1 , -GPMC_CONFIG1_DEVICESIZE_MAX ,"device-width" ); +GPMC_CONFIG1_DEVICESIZE_MAX ,"device-width" );GPMC_GET_RAW (GPMC_CS_CONFIG1 ,16 ,17 ,"wait-pin" );GPMC_GET_RAW_BOOL (GPMC_CS_CONFIG1 ,21 ,21 ,"wait-on-write" );GPMC_GET_RAW_BOOL (GPMC_CS_CONFIG1 ,22 ,22 ,"wait-on-read" );
@@ -623,9 +621,8 @@ static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit, int max l =gpmc_cs_read_reg (cs, reg);#ifdef CONFIG_OMAP_GPMC_DEBUG -pr_info ( -"GPMC CS%d: %-17s: %3d ticks, %3lu ns (was %3i ticks) %3d ns\n" , - cs, name, ticks,gpmc_get_clk_period (cs, cd) * ticks /1000 , +pr_info ("GPMC CS%d: %-17s: %3d ticks, %3lu ns (was %3i ticks) %3d ns\n" , + cs, name, ticks,gpmc_get_clk_period (cs, cd) * ticks /1000 , (l >> st_bit) & mask, time);#endif l &= ~(mask << st_bit);
@@ -652,7 +649,6 @@ static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit, int max*/ static int gpmc_calc_waitmonitoring_divider (unsigned int wait_monitoring) { -int div =gpmc_ns_to_ticks (wait_monitoring); div +=GPMC_CONFIG1_WAITMONITORINGTIME_MAX -1 ;
@@ -664,7 +660,6 @@ static int gpmc_calc_waitmonitoring_divider(unsigned int wait_monitoring) div =1 ;return div; - }/**
@@ -718,7 +713,6 @@ int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t,if (!s->sync_read && !s->sync_write && (s->wait_on_read || s->wait_on_write) ) { - div =gpmc_calc_waitmonitoring_divider (t->wait_monitoring);if (div <0 ) { pr_err("%s: waitmonitoringtime %3d ns too large for greatest gpmcfclkdivider.\n",
@@ -1512,7 +1506,6 @@ static void gpmc_mem_exit(void)continue ;gpmc_cs_delete_mem (cs); } - }static void gpmc_mem_init (void )
@@ -1681,17 +1674,14 @@ static int gpmc_calc_async_read_timings(struct gpmc_timings *gpmc_t,/* oe_on */ temp = dev_t->t_oeasu;if (mux) - temp =max_t (u32, temp, - gpmc_t->adv_rd_off + dev_t->t_aavdh); + temp =max_t (u32, temp, gpmc_t->adv_rd_off + dev_t->t_aavdh); gpmc_t->oe_on =gpmc_round_ps_to_ticks (temp);/* access */ temp =max_t (u32, dev_t->t_iaa,/* XXX: remove t_iaa in async ? */ - gpmc_t->oe_on + dev_t->t_oe); - temp =max_t (u32, temp, - gpmc_t->cs_on + dev_t->t_ce); - temp =max_t (u32, temp, - gpmc_t->adv_on + dev_t->t_aa); + gpmc_t->oe_on + dev_t->t_oe); + temp =max_t (u32, temp, gpmc_t->cs_on + dev_t->t_ce); + temp =max_t (u32, temp, gpmc_t->adv_on + dev_t->t_aa); gpmc_t->access =gpmc_round_ps_to_ticks (temp); gpmc_t->oe_off = gpmc_t->access +gpmc_ticks_to_ps (1 );
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH 8/16 memory: omap-gpmc: Use WARN() instead of BUG() on wrong free
In reply to Krzysztof KozlowskiSince driver tracks reserved memory, freeing a non-reserved GPMC should not be fatal and crash the system. Printing a warning is friendlier.
---
Not tested on HW.
--- drivers/memory/omap-gpmc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/memory/omap-gpmc.c +1 -2
@@ -1072,8 +1072,7 @@ void gpmc_cs_free(int cs)spin_lock (&gpmc_mem_lock);if (cs >= gpmc_cs_num || cs <0 || !gpmc_cs_reserved (cs)) { -printk (KERN_ERR "Trying to free non-reserved GPMC CS%d\n" , cs); -BUG (); +WARN (1 ,"Trying to free non-reserved GPMC CS%d\n" , cs);spin_unlock (&gpmc_mem_lock);return ; }
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH 9/16 memory: omap-gpmc: Fix language typo
In reply to Krzysztof KozlowskiFix arbitary -> arbitrary.
--- drivers/memory/omap-gpmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/memory/omap-gpmc.c +1 -1
@@ -2126,7 +2126,7 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,gpmc_cs_disable_mem (cs);/* -* FIXME: gpmc_cs_request() will map the CS to an arbitary +* FIXME: gpmc_cs_request() will map the CS to an arbitrary * location in the gpmc address space. When booting with * device-tree we want the NOR flash to be mapped to the * location specified in the device-tree blob. So remap the
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH 10/16 memory: omap-gpmc: Consistently use !res for NULL checks
In reply to Krzysztof KozlowskiThe driver already uses 'if (!res)' pattern in the probe function so be consistent.
--- drivers/memory/omap-gpmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/memory/omap-gpmc.c +1 -1
@@ -2393,7 +2393,7 @@ static int gpmc_probe(struct platform_device *pdev)platform_set_drvdata (pdev, gpmc); res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (res ==NULL ) +if (!res)return -ENOENT ; gpmc_base =devm_ioremap_resource (&pdev->dev, res);
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH 11/16 memory: brcmstb_dpfe: Fix language typo
In reply to Krzysztof KozlowskiFix firwmare -> firmware.
--- drivers/memory/brcmstb_dpfe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/memory/brcmstb_dpfe.c +1 -1
@@ -23,7 +23,7 @@* - BE kernel + LE firmware image * - BE kernel + BE firmware image * -* The DPCU always runs in big endian mode. The firwmare image, however, can +* The DPCU always runs in big endian mode. The firmware image, however, can * be in either format. Also, communication between host CPU and DCPU is * always in little endian. */
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH 12/16 memory: brcmstb_dpfe: Add separate entry for compile test
In reply to Krzysztof KozlowskiAdd separate entry for Broadcom STB DPFE driver, selected by platforms by default. This allows further customization and compile testing.
---
I have other changes around drivers/memory/Kconfig pending. Sending them together would avoid conflicts.
--- arch/arm/mach-bcm/Kconfig | 1 + arch/arm64/Kconfig.platforms | 1 + drivers/memory/Kconfig | 11 +++++++++++ drivers/memory/Makefile | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-)
arch/arm/mach-bcm/Kconfig +1 -0
@@ -208,6 +208,7 @@ config ARCH_BRCMSTB select ARM_GIC select ARM_ERRATA_798181 if SMP select HAVE_ARM_ARCH_TIMER + select BRCMSTB_DPFE select BRCMSTB_L2_IRQ select BCM7120_L2_IRQ select ARCH_HAS_HOLES_MEMORYMODEL
arch/arm64/Kconfig.platforms +1 -0
@@ -68,6 +68,7 @@ config ARCH_BRCMSTB bool "Broadcom Set-Top-Box SoCs" select ARCH_HAS_RESET_CONTROLLER select BCM7038_L1_IRQ + select BRCMSTB_DPFE select BRCMSTB_L2_IRQ select GENERIC_IRQ_CHIP select PINCTRL
drivers/memory/Kconfig +11 -0
@@ -54,6 +54,17 @@ config ATMEL_EBI tree is used. This bus supports NANDs, external ethernet controller, SRAMs, ATA devices, etc. +config BRCMSTB_DPFE + bool "Broadcom STB DPFE driver" if COMPILE_TEST + depends on ARCH_BRCMSTB || COMPILE_TEST + help + This driver provides access to the DPFE interface of Broadcom + STB SoCs. The firmware running on the DCPU inside the DDR PHY can + provide current information about the system's RAM, for instance + the DRAM refresh rate. This can be used as an indirect indicator + for the DRAM's temperature. Slower refresh rate means cooler RAM, + higher refresh rate means hotter RAM. + config BT1_L2_CTL bool "Baikal-T1 CM2 L2-RAM Cache Control Block" depends on MIPS_BAIKAL_T1 || COMPILE_TEST
drivers/memory/Makefile +1 -1
@@ -10,7 +10,7 @@ endif obj-$(CONFIG_ARM_PL172_MPMC) += pl172.o obj-$(CONFIG_ATMEL_SDRAMC) += atmel-sdramc.o obj-$(CONFIG_ATMEL_EBI) += atmel-ebi.o -obj-$(CONFIG_ARCH_BRCMSTB) += brcmstb_dpfe.o +obj-$(CONFIG_BRCMSTB_DPFE) += brcmstb_dpfe.o obj-$(CONFIG_BT1_L2_CTL) += bt1-l2-ctl.o obj-$(CONFIG_TI_AEMIF) += ti-aemif.o obj-$(CONFIG_TI_EMIF) += emif.o
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH 13/16 memory: of: Correct kerneldoc
In reply to Krzysztof KozlowskiUse proper kerneldoc to fix GCC warnings like:
drivers/memory/of_memory.c:30: warning: Function parameter or member 'dev' not described in 'of_get_min_tck'
--- drivers/memory/of_memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/memory/of_memory.c +2 -2
@@ -18,7 +18,7 @@/** * of_get_min_tck() - extract min timing values for ddr * @np: pointer to ddr device tree node -* @device: device requesting for min timing values +* @dev: device requesting for min timing values * * Populates the lpddr2_min_tck structure by extracting data * from device tree node. Returns a pointer to the populated
@@ -155,7 +155,7 @@ EXPORT_SYMBOL(of_get_ddr_timings);/** * of_lpddr3_get_min_tck() - extract min timing values for lpddr3 * @np: pointer to ddr device tree node -* @device: device requesting for min timing values +* @dev: device requesting for min timing values * * Populates the lpddr3_min_tck structure by extracting data * from device tree node. Returns a pointer to the populated
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH 14/16 memory: pl172: Enclose macro argument usage in parenthesis
In reply to Krzysztof KozlowskiMacros arguments should be enclosed by parenthesis for safety.
--- drivers/memory/pl172.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/memory/pl172.c +7 -7
@@ -21,7 +21,7 @@#include <linux/of_platform.h> #include <linux/time.h> -#define MPMC_STATIC_CFG (n) (0x200 + 0x20 * n) +#define MPMC_STATIC_CFG (n) (0x200 + 0x20 * (n))#define MPMC_STATIC_CFG_MW_8BIT 0x0#define MPMC_STATIC_CFG_MW_16BIT 0x1#define MPMC_STATIC_CFG_MW_32BIT 0x2
@@ -31,17 +31,17 @@#define MPMC_STATIC_CFG_EW BIT(8)#define MPMC_STATIC_CFG_B BIT(19)#define MPMC_STATIC_CFG_P BIT(20) -#define MPMC_STATIC_WAIT_WEN (n) (0x204 + 0x20 * n) +#define MPMC_STATIC_WAIT_WEN (n) (0x204 + 0x20 * (n))#define MPMC_STATIC_WAIT_WEN_MAX 0x0f -#define MPMC_STATIC_WAIT_OEN (n) (0x208 + 0x20 * n) +#define MPMC_STATIC_WAIT_OEN (n) (0x208 + 0x20 * (n))#define MPMC_STATIC_WAIT_OEN_MAX 0x0f -#define MPMC_STATIC_WAIT_RD (n) (0x20c + 0x20 * n) +#define MPMC_STATIC_WAIT_RD (n) (0x20c + 0x20 * (n))#define MPMC_STATIC_WAIT_RD_MAX 0x1f -#define MPMC_STATIC_WAIT_PAGE (n) (0x210 + 0x20 * n) +#define MPMC_STATIC_WAIT_PAGE (n) (0x210 + 0x20 * (n))#define MPMC_STATIC_WAIT_PAGE_MAX 0x1f -#define MPMC_STATIC_WAIT_WR (n) (0x214 + 0x20 * n) +#define MPMC_STATIC_WAIT_WR (n) (0x214 + 0x20 * (n))#define MPMC_STATIC_WAIT_WR_MAX 0x1f -#define MPMC_STATIC_WAIT_TURN (n) (0x218 + 0x20 * n) +#define MPMC_STATIC_WAIT_TURN (n) (0x218 + 0x20 * (n))#define MPMC_STATIC_WAIT_TURN_MAX 0x0f/* Maximum number of static chip selects */
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH 15/16 memory: samsung: exynos-srom: Correct alignment
In reply to Krzysztof KozlowskiAlign indentation with open parenthesis (or fix existing alignment).
--- drivers/memory/samsung/exynos-srom.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/memory/samsung/exynos-srom.c +11 -11
@@ -47,9 +47,9 @@ struct exynos_srom {struct exynos_srom_reg_dump *reg_offset; }; -static struct exynos_srom_reg_dump *exynos_srom_alloc_reg_dump ( -const unsigned long *rdump, -unsigned long nr_rdump) +static struct exynos_srom_reg_dump * +exynos_srom_alloc_reg_dump (const unsigned long *rdump, +unsigned long nr_rdump) {struct exynos_srom_reg_dump *rd;unsigned int i;
@@ -116,7 +116,7 @@ static int exynos_srom_probe(struct platform_device *pdev) } srom =devm_kzalloc (&pdev->dev, -sizeof (struct exynos_srom ),GFP_KERNEL ); +sizeof (struct exynos_srom ),GFP_KERNEL );if (!srom)return -ENOMEM ;
@@ -130,7 +130,7 @@ static int exynos_srom_probe(struct platform_device *pdev)platform_set_drvdata (pdev, srom); srom->reg_offset =exynos_srom_alloc_reg_dump (exynos_srom_offsets, -ARRAY_SIZE (exynos_srom_offsets)); +ARRAY_SIZE (exynos_srom_offsets));if (!srom->reg_offset) {iounmap (srom->reg_base);return -ENOMEM ;
@@ -157,16 +157,16 @@ static int exynos_srom_probe(struct platform_device *pdev)#ifdef CONFIG_PM_SLEEP static void exynos_srom_save (void __iomem *base, -struct exynos_srom_reg_dump *rd, -unsigned int num_regs) +struct exynos_srom_reg_dump *rd, +unsigned int num_regs) {for (; num_regs >0 ; --num_regs, ++rd) rd->value =readl (base + rd->offset); }static void exynos_srom_restore (void __iomem *base, -const struct exynos_srom_reg_dump *rd, -unsigned int num_regs) +const struct exynos_srom_reg_dump *rd, +unsigned int num_regs) {for (; num_regs >0 ; --num_regs, ++rd)writel (rd->value, base + rd->offset);
@@ -177,7 +177,7 @@ static int exynos_srom_suspend(struct device *dev)struct exynos_srom *srom =dev_get_drvdata (dev);exynos_srom_save (srom->reg_base, srom->reg_offset, -ARRAY_SIZE (exynos_srom_offsets)); +ARRAY_SIZE (exynos_srom_offsets));return 0 ; }
@@ -186,7 +186,7 @@ static int exynos_srom_resume(struct device *dev)struct exynos_srom *srom =dev_get_drvdata (dev);exynos_srom_restore (srom->reg_base, srom->reg_offset, -ARRAY_SIZE (exynos_srom_offsets)); +ARRAY_SIZE (exynos_srom_offsets)); return 0; }#endif
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH 16/16 memory: samsung: exynos5422-dmc: Correct white space issues
In reply to Krzysztof KozlowskiRemove unneeded blank line and align indentation with open parenthesis.
--- drivers/memory/samsung/exynos5422-dmc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/memory/samsung/exynos5422-dmc.c +1 -2
@@ -1394,7 +1394,7 @@ static int exynos5_dmc_probe(struct platform_device *pdev)return PTR_ERR (dmc->base_drexi1); dmc->clk_regmap =syscon_regmap_lookup_by_phandle (np, -"samsung,syscon-clk" ); +"samsung,syscon-clk" );if (IS_ERR (dmc->clk_regmap))return PTR_ERR (dmc->clk_regmap);
@@ -1473,7 +1473,6 @@ static int exynos5_dmc_probe(struct platform_device *pdev) exynos5_dmc_df_profile.polling_ms =500 ; } - dmc->df =devm_devfreq_add_device (dev, &exynos5_dmc_df_profile,DEVFREQ_GOV_SIMPLE_ONDEMAND , &dmc->gov_data);
Signature · 1 line
2.17.1
Re: [PATCH 11/16] memory: brcmstb_dpfe: Fix language typo
In reply to Krzysztof KozlowskiQuoted 3 lines · Krzysztof Kozlowski
Fix firwmare -> firmware.
Signed-off-by Krzysztof Kozlowski <[email protected]>
Signature · 1 line
Florian
Re: [RFT 12/16] memory: brcmstb_dpfe: Add separate entry for compile test
In reply to Krzysztof KozlowskiQuoted 33 lines · Krzysztof Kozlowski
Add separate entry for Broadcom STB DPFE driver, selected by platforms by default. This allows further customization and compile testing.
Signed-off-by Krzysztof Kozlowski <[email protected]>---
I have other changes around
drivers/memory/Kconfigpending. Sending them together would avoid conflicts.--- arch/arm/mach-bcm/Kconfig | 1 + arch/arm64/Kconfig.platforms | 1 + drivers/memory/Kconfig | 11 +++++++++++ drivers/memory/Makefile | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-)arch/arm/mach-bcm/Kconfig +1
-0@@ -208,6 +208,7 @@ config ARCH_BRCMSTB select ARM_GIC select ARM_ERRATA_798181 if SMP select HAVE_ARM_ARCH_TIMER + select BRCMSTB_DPFE select BRCMSTB_L2_IRQ select BCM7120_L2_IRQ select ARCH_HAS_HOLES_MEMORYMODELarch/arm64/Kconfig.platforms +0
-0
arch/arm64/Kconfig.platforms config ARCH_BRCMSTB · line 71
Quoted 4 lines
arch/arm64/Kconfig.platforms +1
-0@@ -68,6 +68,7 @@ config ARCH_BRCMSTB bool "Broadcom Set-Top-Box SoCs" select ARCH_HAS_RESET_CONTROLLER select BCM7038_L1_IRQ + select BRCMSTB_DPFE
The select is probably not warranted, see below.
Quoted 8 lines
arch/arm64/Kconfig.platforms +0
-0select BRCMSTB_L2_IRQ select GENERIC_IRQ_CHIP select PINCTRLdrivers/memory/Kconfig +0
-0
drivers/memory/Kconfig config ATMEL_EBI · line 59
Quoted 6 lines
drivers/memory/Kconfig +3
-0@@ -54,6 +54,17 @@ config ATMEL_EBI tree is used. This bus supports NANDs, external ethernet controller, SRAMs, ATA devices, etc. +config BRCMSTB_DPFE + bool "Broadcom STB DPFE driver" if COMPILE_TEST + depends on ARCH_BRCMSTB || COMPILE_TEST
Can you make it default ARCH_BRCMSTB and remove the select above?
With that:
Quoted 25 lines
drivers/memory/Kconfig +8
-0+ help + This driver provides access to the DPFE interface of Broadcom + STB SoCs. The firmware running on the DCPU inside the DDR PHY can + provide current information about the system's RAM, for instance + the DRAM refresh rate. This can be used as an indirect indicator + for the DRAM's temperature. Slower refresh rate means cooler RAM, + higher refresh rate means hotter RAM. + config BT1_L2_CTL bool "Baikal-T1 CM2 L2-RAM Cache Control Block" depends on MIPS_BAIKAL_T1 || COMPILE_TESTdrivers/memory/Makefile +1
-1@@ -10,7 +10,7 @@ endif obj-$(CONFIG_ARM_PL172_MPMC) += pl172.o obj-$(CONFIG_ATMEL_SDRAMC) += atmel-sdramc.o obj-$(CONFIG_ATMEL_EBI) += atmel-ebi.o -obj-$(CONFIG_ARCH_BRCMSTB) += brcmstb_dpfe.o +obj-$(CONFIG_BRCMSTB_DPFE) += brcmstb_dpfe.o obj-$(CONFIG_BT1_L2_CTL) += bt1-l2-ctl.o obj-$(CONFIG_TI_AEMIF) += ti-aemif.o obj-$(CONFIG_TI_EMIF) += emif.o
Signature · 1 line
Florian
Krzysztof Kozlowski
maintainerRe: [RFT 12/16] memory: brcmstb_dpfe: Add separate entry for compile test
Quoted 58 lines · Florian Fainelli
Quoted 33 lines · Krzysztof Kozlowski
Add separate entry for Broadcom STB DPFE driver, selected by platforms by default. This allows further customization and compile testing.
Signed-off-by Krzysztof Kozlowski <[email protected]>---
I have other changes around
drivers/memory/Kconfigpending. Sending them together would avoid conflicts.--- arch/arm/mach-bcm/Kconfig | 1 + arch/arm64/Kconfig.platforms | 1 + drivers/memory/Kconfig | 11 +++++++++++ drivers/memory/Makefile | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-)arch/arm/mach-bcm/Kconfig +1
-0@@ -208,6 +208,7 @@ config ARCH_BRCMSTB select ARM_GIC select ARM_ERRATA_798181 if SMP select HAVE_ARM_ARCH_TIMER + select BRCMSTB_DPFE select BRCMSTB_L2_IRQ select BCM7120_L2_IRQ select ARCH_HAS_HOLES_MEMORYMODELarch/arm64/Kconfig.platforms +0
-0arch/arm64/Kconfig.platforms config ARCH_BRCMSTB · line 71
Quoted 4 lines
arch/arm64/Kconfig.platforms +1
-0@@ -68,6 +68,7 @@ config ARCH_BRCMSTB bool "Broadcom Set-Top-Box SoCs" select ARCH_HAS_RESET_CONTROLLER select BCM7038_L1_IRQ + select BRCMSTB_DPFEThe select is probably not warranted, see below.
Quoted 8 lines
arch/arm64/Kconfig.platforms +0
-0select BRCMSTB_L2_IRQ select GENERIC_IRQ_CHIP select PINCTRLdrivers/memory/Kconfig +0
-0drivers/memory/Kconfig config ATMEL_EBI · line 59
Quoted 6 lines
drivers/memory/Kconfig +3
-0@@ -54,6 +54,17 @@ config ATMEL_EBI tree is used. This bus supports NANDs, external ethernet controller, SRAMs, ATA devices, etc. +config BRCMSTB_DPFE + bool "Broadcom STB DPFE driver" if COMPILE_TEST + depends on ARCH_BRCMSTB || COMPILE_TESTCan you make it default
ARCH_BRCMSTBand remove the select above?
Quoted 3 lines
With that:
Acked-by Florian Fainelli <[email protected]>
Sure, I'll fix it up. Thanks for feedback.
Best regards,
Krzysztof
Re: [PATCH 14/16] memory: pl172: Enclose macro argument usage in parenthesis
In reply to Krzysztof KozlowskiQuoted 6 lines · Krzysztof Kozlowski
Macros arguments should be enclosed by parenthesis for safety.
Signed-off-by Krzysztof Kozlowski <[email protected]>--- drivers/memory/pl172.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
Applied to drivers/memory tree.
Best regards,
Krzysztof
Re: [PATCH 13/16] memory: of: Correct kerneldoc
In reply to Krzysztof KozlowskiQuoted 8 lines · Krzysztof Kozlowski
Use proper kerneldoc to fix GCC warnings like:
drivers/memory/of_memory.c:30: warning: Function parameter or member 'dev' not described in 'of_get_min_tck'Signed-off-by Krzysztof Kozlowski <[email protected]>--- drivers/memory/of_memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Applied to drivers/memory tree.
Best regards,
Krzysztof
Re: [PATCH 11/16] memory: brcmstb_dpfe: Fix language typo
In reply to Florian FainelliQuoted 6 lines · Florian Fainelli
Quoted 3 lines · Krzysztof Kozlowski
Fix firwmare -> firmware.
Signed-off-by Krzysztof Kozlowski <[email protected]>Acked-by Florian Fainelli <[email protected]>
Thanks!
Applied to drivers/memory tree.
Best regards,
Krzysztof
Re: [PATCH 09/16] memory: omap-gpmc: Fix language typo
In reply to Krzysztof KozlowskiQuoted 6 lines · Krzysztof Kozlowski
Fix arbitary -> arbitrary.
Signed-off-by Krzysztof Kozlowski <[email protected]>--- drivers/memory/omap-gpmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to drivers/memory tree.
Best regards,
Krzysztof
Re: [PATCH 07/16] memory: omap-gpmc: Correct white space issues
In reply to Krzysztof KozlowskiQuoted 7 lines · Krzysztof Kozlowski
Remove some unneeded blank lines, align indentation with open parenthesis (or fix existing alignment).
Signed-off-by Krzysztof Kozlowski <[email protected]>--- drivers/memory/omap-gpmc.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-)
Applied to drivers/memory tree.
Best regards,
Krzysztof
Re: [PATCH 06/16] memory: omap-gpmc: Use 'unsigned int' for consistency
In reply to Krzysztof KozlowskiQuoted 6 lines · Krzysztof Kozlowski
Driver uses 'unsigned int' in other places instead of 'unsigned'.
Signed-off-by Krzysztof Kozlowski <[email protected]>--- drivers/memory/omap-gpmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Applied to drivers/memory tree.
Best regards,
Krzysztof
Re: [PATCH 05/16] memory: omap-gpmc: Enclose macro argument usage in parenthesis
In reply to Krzysztof KozlowskiQuoted 6 lines · Krzysztof Kozlowski
Macros arguments should be enclosed by parenthesis for safety.
Signed-off-by Krzysztof Kozlowski <[email protected]>--- drivers/memory/omap-gpmc.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
Applied to drivers/memory tree.
Best regards,
Krzysztof
Re: [PATCH 04/16] memory: omap-gpmc: Correct kerneldoc
In reply to Krzysztof KozlowskiQuoted 9 lines · Krzysztof Kozlowski
Use proper kerneldoc to fix GCC warnings like:
drivers/memory/omap-gpmc.c:299: warning: Function parameter or member 'cs' not described in 'gpmc_get_clk_period'drivers/memory/omap-gpmc.c:432: warning: Excess function parameter 'ma' description in 'get_gpmc_timing_reg'Signed-off-by Krzysztof Kozlowski <[email protected]>--- drivers/memory/omap-gpmc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Applied to drivers/memory tree.
Best regards,
Krzysztof
Re: [PATCH 03/16] memory: mvebu-devbus: Align with open parenthesis
In reply to Krzysztof KozlowskiQuoted 7 lines · Krzysztof Kozlowski
The line continuation contained spaces but still failed to properly align with open parenthesis.
Signed-off-by Krzysztof Kozlowski <[email protected]>--- drivers/memory/mvebu-devbus.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
Applied to drivers/memory tree.
Best regards,
Krzysztof
Re: [PATCH 02/16] memory: mvebu-devbus: Add missing braces to all arms of if statement
In reply to Krzysztof KozlowskiQuoted 7 lines · Krzysztof Kozlowski
Add missing braces to all arms of if statement to align with coding convention.
Signed-off-by Krzysztof Kozlowski <[email protected]>--- drivers/memory/mvebu-devbus.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Applied to drivers/memory tree.
Best regards,
Krzysztof
Re: [PATCH 01/16] memory: bt1-l2-ctl: Add blank lines after declarations
In reply to Krzysztof KozlowskiQuoted 6 lines · Krzysztof Kozlowski
Add blank lines to improve code readability. No functional change.
Signed-off-by Krzysztof Kozlowski <[email protected]>--- drivers/memory/bt1-l2-ctl.c | 2 ++ 1 file changed, 2 insertions(+)
Applied to drivers/memory tree.
Best regards,
Krzysztof
Re: [RFT 08/16] memory: omap-gpmc: Use WARN() instead of BUG() on wrong free
In reply to Krzysztof KozlowskiQuoted 10 lines · Krzysztof Kozlowski
Since driver tracks reserved memory, freeing a non-reserved GPMC should not be fatal and crash the system. Printing a warning is friendlier.
Signed-off-by Krzysztof Kozlowski <[email protected]>---
Not tested on HW.
--- drivers/memory/omap-gpmc.c | 3 +--
Applied.
Best regards,
Krzysztof
Re: [PATCH 10/16] memory: omap-gpmc: Consistently use !res for NULL checks
In reply to Krzysztof KozlowskiQuoted 6 lines · Krzysztof Kozlowski
The driver already uses 'if (!res)' pattern in the probe function so be consistent.
Signed-off-by Krzysztof Kozlowski <[email protected]>--- drivers/memory/omap-gpmc.c | 2 +-
Applied.
Best regards,
Krzysztof
Krzysztof Kozlowski
maintainerRe: [RFT 12/16] memory: brcmstb_dpfe: Add separate entry for compile test
In reply to Florian FainelliQuoted 58 lines · Florian Fainelli
Quoted 33 lines · Krzysztof Kozlowski
Add separate entry for Broadcom STB DPFE driver, selected by platforms by default. This allows further customization and compile testing.
Signed-off-by Krzysztof Kozlowski <[email protected]>---
I have other changes around
drivers/memory/Kconfigpending. Sending them together would avoid conflicts.--- arch/arm/mach-bcm/Kconfig | 1 + arch/arm64/Kconfig.platforms | 1 + drivers/memory/Kconfig | 11 +++++++++++ drivers/memory/Makefile | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-)arch/arm/mach-bcm/Kconfig +1
-0@@ -208,6 +208,7 @@ config ARCH_BRCMSTB select ARM_GIC select ARM_ERRATA_798181 if SMP select HAVE_ARM_ARCH_TIMER + select BRCMSTB_DPFE select BRCMSTB_L2_IRQ select BCM7120_L2_IRQ select ARCH_HAS_HOLES_MEMORYMODELarch/arm64/Kconfig.platforms +0
-0arch/arm64/Kconfig.platforms config ARCH_BRCMSTB · line 71
Quoted 4 lines
arch/arm64/Kconfig.platforms +1
-0@@ -68,6 +68,7 @@ config ARCH_BRCMSTB bool "Broadcom Set-Top-Box SoCs" select ARCH_HAS_RESET_CONTROLLER select BCM7038_L1_IRQ + select BRCMSTB_DPFEThe select is probably not warranted, see below.
Quoted 8 lines
arch/arm64/Kconfig.platforms +0
-0select BRCMSTB_L2_IRQ select GENERIC_IRQ_CHIP select PINCTRLdrivers/memory/Kconfig +0
-0drivers/memory/Kconfig config ATMEL_EBI · line 59
Quoted 6 lines
drivers/memory/Kconfig +3
-0@@ -54,6 +54,17 @@ config ATMEL_EBI tree is used. This bus supports NANDs, external ethernet controller, SRAMs, ATA devices, etc. +config BRCMSTB_DPFE + bool "Broadcom STB DPFE driver" if COMPILE_TEST + depends on ARCH_BRCMSTB || COMPILE_TESTCan you make it default
ARCH_BRCMSTBand remove the select above?
Quoted 3 lines
With that:
Acked-by Florian Fainelli <[email protected]>
Applied with mentioned change.
Best regards,
Krzysztof
Re: [PATCH 16/16] memory: samsung: exynos5422-dmc: Correct white space issues
In reply to Krzysztof KozlowskiQuoted 22 lines · Krzysztof Kozlowski
Remove unneeded blank line and align indentation with open parenthesis.
Signed-off-by Krzysztof Kozlowski <[email protected]>--- drivers/memory/samsung/exynos5422-dmc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/memory/samsung/exynos5422-dmc.c +1
-1@@ -1394,7 +1394,7 @@ static int exynos5_dmc_probe(struct platform_device *pdev)return PTR_ERR (dmc->base_drexi1); dmc->clk_regmap =syscon_regmap_lookup_by_phandle (np, -"samsung,syscon-clk" ); +"samsung,syscon-clk" );if (IS_ERR (dmc->clk_regmap))return PTR_ERR (dmc->clk_regmap);
drivers/memory/samsung/exynos5422-dmc.c static int exynos5_dmc_probe(struct platform_device *pdev) · line 1478
Quoted 7 lines
drivers/memory/samsung/exynos5422-dmc.c +0
-1@@ -1473,7 +1473,6 @@ static int exynos5_dmc_probe(struct platform_device *pdev) exynos5_dmc_df_profile.polling_ms =500 ; } - dmc->df =devm_devfreq_add_device (dev, &exynos5_dmc_df_profile,DEVFREQ_GOV_SIMPLE_ONDEMAND , &dmc->gov_data);
LGTM
Regards,
Lukasz