ARM: ux500: remove unused regulator data
Subsystems (9)
PATCH 1/11 ARM: ux500: remove unused regulator data
From: Arnd Bergmann <[email protected]>
Most of the board-mop500-regulators.c file is never referenced and can simply be removed.
---
Mark: this CC is to give you the requested context for the next two patches.
--- arch/arm/mach-ux500/board-mop500-regulators.c | 600 -------------------------- arch/arm/mach-ux500/board-mop500-regulators.h | 8 - 2 files changed, 608 deletions(-)
arch/arm/mach-ux500/board-mop500-regulators.c +0 -600
@@ -13,46 +13,6 @@#include <linux/regulator/machine.h> #include <linux/regulator/ab8500.h> #include "board-mop500-regulators.h" -#include "id.h" - -static struct regulator_consumer_supply gpio_en_3v3_consumers[] = { -REGULATOR_SUPPLY ("vdd33a" ,"smsc911x.0" ), -}; - -struct regulator_init_data gpio_en_3v3_regulator = { - .constraints = { - .name ="EN-3V3" , - .min_uV =3300000 , - .max_uV =3300000 , - .valid_ops_mask =REGULATOR_CHANGE_STATUS , - }, - .num_consumer_supplies =ARRAY_SIZE (gpio_en_3v3_consumers), - .consumer_supplies = gpio_en_3v3_consumers, -}; - -/* -* TPS61052 regulator -*/ -static struct regulator_consumer_supply tps61052_vaudio_consumers[] = { -/* -* Boost converter supply to raise voltage on audio speaker, this -* is actually connected to three pins, VInVhfL (left amplifier) -* VInVhfR (right amplifier) and VIntDClassInt - all three must -* be connected to the same voltage. -*/ -REGULATOR_SUPPLY ("vintdclassint" ,"ab8500-codec.0" ), -}; - -struct regulator_init_data tps61052_regulator = { - .constraints = { - .name ="vaudio-hf" , - .min_uV =4500000 , - .max_uV =4500000 , - .valid_ops_mask =REGULATOR_CHANGE_STATUS , - }, - .num_consumer_supplies =ARRAY_SIZE (tps61052_vaudio_consumers), - .consumer_supplies = tps61052_vaudio_consumers, -};static struct regulator_consumer_supply ab8500_vaux1_consumers[] = {/* Main display, u8500 R3 uib */
@@ -107,27 +67,6 @@ static struct regulator_consumer_supply ab8500_vaux3_consumers[] = { REGULATOR_SUPPLY("vmmc", "sdi0"), }; -static struct regulator_consumer_supply ab8505_vaux4_consumers[] = { -}; - -static struct regulator_consumer_supply ab8505_vaux5_consumers[] = { -}; - -static struct regulator_consumer_supply ab8505_vaux6_consumers[] = { -}; - -static struct regulator_consumer_supply ab8505_vaux8_consumers[] = { -/* AB8500 audio codec device */ -REGULATOR_SUPPLY ("v-aux8" ,NULL ), -}; - -static struct regulator_consumer_supply ab8505_vadc_consumers[] = { -/* Internal general-purpose ADC */ -REGULATOR_SUPPLY ("vddadc" ,"ab8500-gpadc.0" ), -/* ADC for charger */ -REGULATOR_SUPPLY ("vddadc" ,"ab8500-charger.0" ), -}; -static struct regulator_consumer_supply ab8500_vtvout_consumers[] = {/* TV-out DENC supply */ REGULATOR_SUPPLY ("vtvout" ,"ab8500-denc.0" ),
@@ -168,11 +107,6 @@ static struct regulator_consumer_supply ab8500_vintcore_consumers[] = { REGULATOR_SUPPLY("v-intcore", "abx500-clk.0"), }; -static struct regulator_consumer_supply ab8505_usb_consumers[] = { -/* HS USB OTG physical interface */ -REGULATOR_SUPPLY ("v-ape" ,NULL ), -}; -static struct regulator_consumer_supply ab8500_vana_consumers[] = {/* DB8500 DSI */ REGULATOR_SUPPLY ("vdddsi1v2" ,"mcde" ),
@@ -483,11 +417,6 @@ static struct regulator_consumer_supply ab8500_ext_supply3_consumers[] = { REGULATOR_SUPPLY("vinvsim", "sim-detect.0"), }; -/* extended configuration for VextSupply2, only used for HREFP_V20 boards */ -static struct ab8500_ext_regulator_cfg ab8500_ext_supply2 = { - .hwreq = true, -}; -/* * AB8500 external regulators */
@@ -526,456 +455,6 @@ static struct regulator_init_data ab8500_ext_regulators[] = { }, }; -/* ab8505 regulator register initialization */ -static struct ab8500_regulator_reg_init ab8505_reg_init[] = { -/* -* VarmRequestCtrl -* VsmpsCRequestCtrl -* VsmpsARequestCtrl -* VsmpsBRequestCtrl -*/ -INIT_REGULATOR_REGISTER (AB8505_REGUREQUESTCTRL1 ,0x00 ,0x00 ), -/* -* VsafeRequestCtrl -* VpllRequestCtrl -* VanaRequestCtrl = HP/LP depending on VxRequest -*/ -INIT_REGULATOR_REGISTER (AB8505_REGUREQUESTCTRL2 ,0x30 ,0x00 ), -/* -* Vaux1RequestCtrl = HP/LP depending on VxRequest -* Vaux2RequestCtrl = HP/LP depending on VxRequest -*/ -INIT_REGULATOR_REGISTER (AB8505_REGUREQUESTCTRL3 ,0xf0 ,0x00 ), -/* -* Vaux3RequestCtrl = HP/LP depending on VxRequest -* SwHPReq = Control through SWValid disabled -*/ -INIT_REGULATOR_REGISTER (AB8505_REGUREQUESTCTRL4 ,0x07 ,0x00 ), -/* -* VsmpsASysClkReq1HPValid -* VsmpsBSysClkReq1HPValid -* VsafeSysClkReq1HPValid -* VanaSysClkReq1HPValid = disabled -* VpllSysClkReq1HPValid -* Vaux1SysClkReq1HPValid = disabled -* Vaux2SysClkReq1HPValid = disabled -* Vaux3SysClkReq1HPValid = disabled -*/ -INIT_REGULATOR_REGISTER (AB8505_REGUSYSCLKREQ1HPVALID1 ,0xe8 ,0x00 ), -/* -* VsmpsCSysClkReq1HPValid -* VarmSysClkReq1HPValid -* VbbSysClkReq1HPValid -* VsmpsMSysClkReq1HPValid -*/ -INIT_REGULATOR_REGISTER (AB8505_REGUSYSCLKREQ1HPVALID2 ,0x00 ,0x00 ), -/* -* VsmpsAHwHPReq1Valid -* VsmpsBHwHPReq1Valid -* VsafeHwHPReq1Valid -* VanaHwHPReq1Valid = disabled -* VpllHwHPReq1Valid -* Vaux1HwHPreq1Valid = disabled -* Vaux2HwHPReq1Valid = disabled -* Vaux3HwHPReqValid = disabled -*/ -INIT_REGULATOR_REGISTER (AB8505_REGUHWHPREQ1VALID1 ,0xe8 ,0x00 ), -/* -* VsmpsMHwHPReq1Valid -*/ -INIT_REGULATOR_REGISTER (AB8505_REGUHWHPREQ1VALID2 ,0x00 ,0x00 ), -/* -* VsmpsAHwHPReq2Valid -* VsmpsBHwHPReq2Valid -* VsafeHwHPReq2Valid -* VanaHwHPReq2Valid = disabled -* VpllHwHPReq2Valid -* Vaux1HwHPReq2Valid = disabled -* Vaux2HwHPReq2Valid = disabled -* Vaux3HwHPReq2Valid = disabled -*/ -INIT_REGULATOR_REGISTER (AB8505_REGUHWHPREQ2VALID1 ,0xe8 ,0x00 ), -/* -* VsmpsMHwHPReq2Valid -*/ -INIT_REGULATOR_REGISTER (AB8505_REGUHWHPREQ2VALID2 ,0x00 ,0x00 ), -/** -* VsmpsCSwHPReqValid -* VarmSwHPReqValid -* VsmpsASwHPReqValid -* VsmpsBSwHPReqValid -* VsafeSwHPReqValid -* VanaSwHPReqValid -* VanaSwHPReqValid = disabled -* VpllSwHPReqValid -* Vaux1SwHPReqValid = disabled -*/ -INIT_REGULATOR_REGISTER (AB8505_REGUSWHPREQVALID1 ,0xa0 ,0x00 ), -/* -* Vaux2SwHPReqValid = disabled -* Vaux3SwHPReqValid = disabled -* VsmpsMSwHPReqValid -*/ -INIT_REGULATOR_REGISTER (AB8505_REGUSWHPREQVALID2 ,0x03 ,0x00 ), -/* -* SysClkReq2Valid1 = SysClkReq2 controlled -* SysClkReq3Valid1 = disabled -* SysClkReq4Valid1 = SysClkReq4 controlled -*/ -INIT_REGULATOR_REGISTER (AB8505_REGUSYSCLKREQVALID1 ,0x0e ,0x0a ), -/* -* SysClkReq2Valid2 = disabled -* SysClkReq3Valid2 = disabled -* SysClkReq4Valid2 = disabled -*/ -INIT_REGULATOR_REGISTER (AB8505_REGUSYSCLKREQVALID2 ,0x0e ,0x00 ), -/* -* Vaux4SwHPReqValid -* Vaux4HwHPReq2Valid -* Vaux4HwHPReq1Valid -* Vaux4SysClkReq1HPValid -*/ -INIT_REGULATOR_REGISTER (AB8505_REGUVAUX4REQVALID ,0x00 ,0x00 ), -/* -* VadcEna = disabled -* VintCore12Ena = disabled -* VintCore12Sel = 1.25 V -* VintCore12LP = inactive (HP) -* VadcLP = inactive (HP) -*/ -INIT_REGULATOR_REGISTER (AB8505_REGUMISC1 ,0xfe ,0x10 ), -/* -* VaudioEna = disabled -* Vaux8Ena = disabled -* Vamic1Ena = disabled -* Vamic2Ena = disabled -*/ -INIT_REGULATOR_REGISTER (AB8505_VAUDIOSUPPLY ,0x1e ,0x00 ), -/* -* Vamic1_dzout = high-Z when Vamic1 is disabled -* Vamic2_dzout = high-Z when Vamic2 is disabled -*/ -INIT_REGULATOR_REGISTER (AB8505_REGUCTRL1VAMIC ,0x03 ,0x00 ), -/* -* VsmpsARegu -* VsmpsASelCtrl -* VsmpsAAutoMode -* VsmpsAPWMMode -*/ -INIT_REGULATOR_REGISTER (AB8505_VSMPSAREGU ,0x00 ,0x00 ), -/* -* VsmpsBRegu -* VsmpsBSelCtrl -* VsmpsBAutoMode -* VsmpsBPWMMode -*/ -INIT_REGULATOR_REGISTER (AB8505_VSMPSBREGU ,0x00 ,0x00 ), -/* -* VsafeRegu -* VsafeSelCtrl -* VsafeAutoMode -* VsafePWMMode -*/ -INIT_REGULATOR_REGISTER (AB8505_VSAFEREGU ,0x00 ,0x00 ), -/* -* VPll = Hw controlled (NOTE! PRCMU bits) -* VanaRegu = force off -*/ -INIT_REGULATOR_REGISTER (AB8505_VPLLVANAREGU ,0x0f ,0x02 ), -/* -* VextSupply1Regu = force OFF (OTP_ExtSupply12LPnPolarity 1) -* VextSupply2Regu = force OFF (OTP_ExtSupply12LPnPolarity 1) -* VextSupply3Regu = force OFF (OTP_ExtSupply3LPnPolarity 0) -* ExtSupply2Bypass = ExtSupply12LPn ball is 0 when Ena is 0 -* ExtSupply3Bypass = ExtSupply3LPn ball is 0 when Ena is 0 -*/ -INIT_REGULATOR_REGISTER (AB8505_EXTSUPPLYREGU ,0xff ,0x30 ), -/* -* Vaux1Regu = force HP -* Vaux2Regu = force off -*/ -INIT_REGULATOR_REGISTER (AB8505_VAUX12REGU ,0x0f ,0x01 ), -/* -* Vaux3Regu = force off -*/ -INIT_REGULATOR_REGISTER (AB8505_VRF1VAUX3REGU ,0x03 ,0x00 ), -/* -* VsmpsASel1 -*/ -INIT_REGULATOR_REGISTER (AB8505_VSMPSASEL1 ,0x00 ,0x00 ), -/* -* VsmpsASel2 -*/ -INIT_REGULATOR_REGISTER (AB8505_VSMPSASEL2 ,0x00 ,0x00 ), -/* -* VsmpsASel3 -*/ -INIT_REGULATOR_REGISTER (AB8505_VSMPSASEL3 ,0x00 ,0x00 ), -/* -* VsmpsBSel1 -*/ -INIT_REGULATOR_REGISTER (AB8505_VSMPSBSEL1 ,0x00 ,0x00 ), -/* -* VsmpsBSel2 -*/ -INIT_REGULATOR_REGISTER (AB8505_VSMPSBSEL2 ,0x00 ,0x00 ), -/* -* VsmpsBSel3 -*/ -INIT_REGULATOR_REGISTER (AB8505_VSMPSBSEL3 ,0x00 ,0x00 ), -/* -* VsafeSel1 -*/ -INIT_REGULATOR_REGISTER (AB8505_VSAFESEL1 ,0x00 ,0x00 ), -/* -* VsafeSel2 -*/ -INIT_REGULATOR_REGISTER (AB8505_VSAFESEL2 ,0x00 ,0x00 ), -/* -* VsafeSel3 -*/ -INIT_REGULATOR_REGISTER (AB8505_VSAFESEL3 ,0x00 ,0x00 ), -/* -* Vaux1Sel = 2.8 V -*/ -INIT_REGULATOR_REGISTER (AB8505_VAUX1SEL ,0x0f ,0x0C ), -/* -* Vaux2Sel = 2.9 V -*/ -INIT_REGULATOR_REGISTER (AB8505_VAUX2SEL ,0x0f ,0x0d ), -/* -* Vaux3Sel = 2.91 V -*/ -INIT_REGULATOR_REGISTER (AB8505_VRF1VAUX3SEL ,0x07 ,0x07 ), -/* -* Vaux4RequestCtrl -*/ -INIT_REGULATOR_REGISTER (AB8505_VAUX4REQCTRL ,0x00 ,0x00 ), -/* -* Vaux4Regu -*/ -INIT_REGULATOR_REGISTER (AB8505_VAUX4REGU ,0x00 ,0x00 ), -/* -* Vaux4Sel -*/ -INIT_REGULATOR_REGISTER (AB8505_VAUX4SEL ,0x00 ,0x00 ), -/* -* Vaux1Disch = short discharge time -* Vaux2Disch = short discharge time -* Vaux3Disch = short discharge time -* Vintcore12Disch = short discharge time -* VTVoutDisch = short discharge time -* VaudioDisch = short discharge time -*/ -INIT_REGULATOR_REGISTER (AB8505_REGUCTRLDISCH ,0xfc ,0x00 ), -/* -* VanaDisch = short discharge time -* Vaux8PullDownEna = pulldown disabled when Vaux8 is disabled -* Vaux8Disch = short discharge time -*/ -INIT_REGULATOR_REGISTER (AB8505_REGUCTRLDISCH2 ,0x16 ,0x00 ), -/* -* Vaux4Disch = short discharge time -*/ -INIT_REGULATOR_REGISTER (AB8505_REGUCTRLDISCH3 ,0x01 ,0x00 ), -/* -* Vaux5Sel -* Vaux5LP -* Vaux5Ena -* Vaux5Disch -* Vaux5DisSfst -* Vaux5DisPulld -*/ -INIT_REGULATOR_REGISTER (AB8505_CTRLVAUX5 ,0x00 ,0x00 ), -/* -* Vaux6Sel -* Vaux6LP -* Vaux6Ena -* Vaux6DisPulld -*/ -INIT_REGULATOR_REGISTER (AB8505_CTRLVAUX6 ,0x00 ,0x00 ), -}; - -static struct regulator_init_data ab8505_regulators[AB8505_NUM_REGULATORS ] = { -/* supplies to the display/camera */ - [AB8505_LDO_AUX1 ] = { - .constraints = { - .name ="V-DISPLAY" , - .min_uV =2800000 , - .max_uV =3300000 , - .valid_ops_mask =REGULATOR_CHANGE_VOLTAGE | -REGULATOR_CHANGE_STATUS , - .boot_on =1 ,/* display is on at boot */ - }, - .num_consumer_supplies =ARRAY_SIZE (ab8500_vaux1_consumers), - .consumer_supplies = ab8500_vaux1_consumers, - }, -/* supplies to the on-board eMMC */ - [AB8505_LDO_AUX2 ] = { - .constraints = { - .name ="V-eMMC1" , - .min_uV =1100000 , - .max_uV =3300000 , - .valid_ops_mask =REGULATOR_CHANGE_VOLTAGE | -REGULATOR_CHANGE_STATUS | -REGULATOR_CHANGE_MODE , - .valid_modes_mask =REGULATOR_MODE_NORMAL | -REGULATOR_MODE_IDLE , - }, - .num_consumer_supplies =ARRAY_SIZE (ab8500_vaux2_consumers), - .consumer_supplies = ab8500_vaux2_consumers, - }, -/* supply for VAUX3, supplies to SDcard slots */ - [AB8505_LDO_AUX3 ] = { - .constraints = { - .name ="V-MMC-SD" , - .min_uV =1100000 , - .max_uV =3300000 , - .valid_ops_mask =REGULATOR_CHANGE_VOLTAGE | -REGULATOR_CHANGE_STATUS | -REGULATOR_CHANGE_MODE , - .valid_modes_mask =REGULATOR_MODE_NORMAL | -REGULATOR_MODE_IDLE , - }, - .num_consumer_supplies =ARRAY_SIZE (ab8500_vaux3_consumers), - .consumer_supplies = ab8500_vaux3_consumers, - }, -/* supply for VAUX4, supplies to NFC and standalone secure element */ - [AB8505_LDO_AUX4 ] = { - .constraints = { - .name ="V-NFC-SE" , - .min_uV =1100000 , - .max_uV =3300000 , - .valid_ops_mask =REGULATOR_CHANGE_VOLTAGE | -REGULATOR_CHANGE_STATUS | -REGULATOR_CHANGE_MODE , - .valid_modes_mask =REGULATOR_MODE_NORMAL | -REGULATOR_MODE_IDLE , - }, - .num_consumer_supplies =ARRAY_SIZE (ab8505_vaux4_consumers), - .consumer_supplies = ab8505_vaux4_consumers, - }, -/* supply for VAUX5, supplies to TBD */ - [AB8505_LDO_AUX5 ] = { - .constraints = { - .name ="V-AUX5" , - .min_uV =1050000 , - .max_uV =2790000 , - .valid_ops_mask =REGULATOR_CHANGE_VOLTAGE | -REGULATOR_CHANGE_STATUS | -REGULATOR_CHANGE_MODE , - .valid_modes_mask =REGULATOR_MODE_NORMAL | -REGULATOR_MODE_IDLE , - }, - .num_consumer_supplies =ARRAY_SIZE (ab8505_vaux5_consumers), - .consumer_supplies = ab8505_vaux5_consumers, - }, -/* supply for VAUX6, supplies to TBD */ - [AB8505_LDO_AUX6 ] = { - .constraints = { - .name ="V-AUX6" , - .min_uV =1050000 , - .max_uV =2790000 , - .valid_ops_mask =REGULATOR_CHANGE_VOLTAGE | -REGULATOR_CHANGE_STATUS | -REGULATOR_CHANGE_MODE , - .valid_modes_mask =REGULATOR_MODE_NORMAL | -REGULATOR_MODE_IDLE , - }, - .num_consumer_supplies =ARRAY_SIZE (ab8505_vaux6_consumers), - .consumer_supplies = ab8505_vaux6_consumers, - }, -/* supply for gpadc, ADC LDO */ - [AB8505_LDO_ADC ] = { - .constraints = { - .name ="V-ADC" , - .valid_ops_mask =REGULATOR_CHANGE_STATUS , - }, - .num_consumer_supplies =ARRAY_SIZE (ab8505_vadc_consumers), - .consumer_supplies = ab8505_vadc_consumers, - }, -/* supply for ab8500-vaudio, VAUDIO LDO */ - [AB8505_LDO_AUDIO ] = { - .constraints = { - .name ="V-AUD" , - .valid_ops_mask =REGULATOR_CHANGE_STATUS , - }, - .num_consumer_supplies =ARRAY_SIZE (ab8500_vaud_consumers), - .consumer_supplies = ab8500_vaud_consumers, - }, -/* supply for v-anamic1 VAMic1-LDO */ - [AB8505_LDO_ANAMIC1 ] = { - .constraints = { - .name ="V-AMIC1" , - .valid_ops_mask =REGULATOR_CHANGE_STATUS | -REGULATOR_CHANGE_MODE , - .valid_modes_mask =REGULATOR_MODE_NORMAL | -REGULATOR_MODE_IDLE , - }, - .num_consumer_supplies =ARRAY_SIZE (ab8500_vamic1_consumers), - .consumer_supplies = ab8500_vamic1_consumers, - }, -/* supply for v-amic2, VAMIC2 LDO, reuse constants for AMIC1 */ - [AB8505_LDO_ANAMIC2 ] = { - .constraints = { - .name ="V-AMIC2" , - .valid_ops_mask =REGULATOR_CHANGE_STATUS | -REGULATOR_CHANGE_MODE , - .valid_modes_mask =REGULATOR_MODE_NORMAL | -REGULATOR_MODE_IDLE , - }, - .num_consumer_supplies =ARRAY_SIZE (ab8500_vamic2_consumers), - .consumer_supplies = ab8500_vamic2_consumers, - }, -/* supply for v-aux8, VAUX8 LDO */ - [AB8505_LDO_AUX8 ] = { - .constraints = { - .name ="V-AUX8" , - .valid_ops_mask =REGULATOR_CHANGE_STATUS , - }, - .num_consumer_supplies =ARRAY_SIZE (ab8505_vaux8_consumers), - .consumer_supplies = ab8505_vaux8_consumers, - }, -/* supply for v-intcore12, VINTCORE12 LDO */ - [AB8505_LDO_INTCORE ] = { - .constraints = { - .name ="V-INTCORE" , - .min_uV =1250000 , - .max_uV =1350000 , - .input_uV =1800000 , - .valid_ops_mask =REGULATOR_CHANGE_VOLTAGE | -REGULATOR_CHANGE_STATUS | -REGULATOR_CHANGE_MODE | -REGULATOR_CHANGE_DRMS , - .valid_modes_mask =REGULATOR_MODE_NORMAL | -REGULATOR_MODE_IDLE , - }, - .num_consumer_supplies =ARRAY_SIZE (ab8500_vintcore_consumers), - .consumer_supplies = ab8500_vintcore_consumers, - }, -/* supply for LDO USB */ - [AB8505_LDO_USB ] = { - .constraints = { - .name ="V-USB" , - .valid_ops_mask =REGULATOR_CHANGE_STATUS | -REGULATOR_CHANGE_MODE , - .valid_modes_mask =REGULATOR_MODE_NORMAL | -REGULATOR_MODE_IDLE , - }, - .num_consumer_supplies =ARRAY_SIZE (ab8505_usb_consumers), - .consumer_supplies = ab8505_usb_consumers, - }, -/* supply for U8500 CSI-DSI, VANA LDO */ - [AB8505_LDO_ANA ] = { - .constraints = { - .name ="V-CSI-DSI" , - .valid_ops_mask =REGULATOR_CHANGE_STATUS , - }, - .num_consumer_supplies =ARRAY_SIZE (ab8500_vana_consumers), - .consumer_supplies = ab8500_vana_consumers, - }, -}; -struct ab8500_regulator_platform_data ab8500_regulator_plat_data = { .reg_init = ab8500_reg_init, .num_reg_init =ARRAY_SIZE (ab8500_reg_init),
@@ -984,82 +463,3 @@ struct ab8500_regulator_platform_data ab8500_regulator_plat_data = { .ext_regulator = ab8500_ext_regulators, .num_ext_regulator = ARRAY_SIZE(ab8500_ext_regulators), }; - -struct ab8500_regulator_platform_data ab8505_regulator_plat_data = { - .reg_init = ab8505_reg_init, - .num_reg_init =ARRAY_SIZE (ab8505_reg_init), - .regulator = ab8505_regulators, - .num_regulator =ARRAY_SIZE (ab8505_regulators), -}; - -static void ab8500_modify_reg_init (int id,u8 mask,u8 value) -{ -int i; - -if (cpu_is_u8520 ()) { -for (i =ARRAY_SIZE (ab8505_reg_init) -1 ; i >=0 ; i--) { -if (ab8505_reg_init[i].id == id) { -u8 initval = ab8505_reg_init[i].value; - initval = (initval & ~mask) | (value & mask); - ab8505_reg_init[i].value = initval; - -BUG_ON (mask & ~ab8505_reg_init[i].mask); -return ; - } - } - }else { -for (i =ARRAY_SIZE (ab8500_reg_init) -1 ; i >=0 ; i--) { -if (ab8500_reg_init[i].id == id) { -u8 initval = ab8500_reg_init[i].value; - initval = (initval & ~mask) | (value & mask); - ab8500_reg_init[i].value = initval; - -BUG_ON (mask & ~ab8500_reg_init[i].mask); -return ; - } - } - } - -BUG_ON (1 ); -} - -void mop500_regulator_init (void ) -{ -struct regulator_init_data *regulator; - -/* -* Temporarily turn on Vaux2 on 8520 machine -*/ -if (cpu_is_u8520 ()) { -/* Vaux2 initialized to be on */ -ab8500_modify_reg_init (AB8505_VAUX12REGU ,0x0f ,0x05 ); - } - -/* -* Handle AB8500_EXT_SUPPLY2 on HREFP_V20_V50 boards (do it for -* all HREFP_V20 boards) -*/ -if (cpu_is_u8500v20 ()) { -/* VextSupply2RequestCtrl = HP/OFF depending on VxRequest */ -ab8500_modify_reg_init (AB8500_REGUREQUESTCTRL3 ,0x01 ,0x01 ); - -/* VextSupply2SysClkReq1HPValid = SysClkReq1 controlled */ -ab8500_modify_reg_init (AB8500_REGUSYSCLKREQ1HPVALID2 , -0x20 ,0x20 ); - -/* VextSupply2 = force HP at initialization */ -ab8500_modify_reg_init (AB8500_EXTSUPPLYREGU ,0x0c ,0x04 ); - -/* enable VextSupply2 during platform active */ - regulator = &ab8500_ext_regulators[AB8500_EXT_SUPPLY2 ]; - regulator->constraints.always_on =1 ; - -/* disable VextSupply2 in suspend */ - regulator = &ab8500_ext_regulators[AB8500_EXT_SUPPLY2 ]; - regulator->constraints.state_mem.disabled =1 ; - regulator->constraints.state_standby.disabled =1 ; - -/* enable VextSupply2 HW control (used in suspend) */ - regulator->driver_data = (void *)&ab8500_ext_supply2; - } -}
arch/arm/mach-ux500/board-mop500-regulators.h +0 -8
@@ -11,14 +11,6 @@#ifndef __BOARD_MOP500_REGULATORS_H#define __BOARD_MOP500_REGULATORS_H -#include <linux/regulator/machine.h> -#include <linux/regulator/ab8500.h> -extern struct ab8500_regulator_platform_data ab8500_regulator_plat_data; -extern struct ab8500_regulator_platform_data ab8505_regulator_plat_data; -extern struct regulator_init_data tps61052_regulator; -extern struct regulator_init_data gpio_en_3v3_regulator; - -void mop500_regulator_init (void );#endif
Signature · 1 line
2.4.11
PATCH 2/11 ARM: ux500: move ab8500_regulator_plat_data into driver
From: Arnd Bergmann <[email protected]>
There is only one instance of ab8500_regulator_platform_data, and it's safe to assume we won't ever merge another one, so it's rather pointless to pass it through multiple levels of platform data pointers.
This moves the structure and everything referenced by it into the driver that uses it.
---
Mark: if this makes sense to you, please provide an ACK so Arnd can merge this cleanup.
--- arch/arm/mach-ux500/Makefile | 3 +- arch/arm/mach-ux500/board-mop500-regulators.c | 465 -------------------------- arch/arm/mach-ux500/board-mop500-regulators.h | 16 - arch/arm/mach-ux500/cpu-db8500.c | 2 - drivers/regulator/ab8500-ext.c | 465 +++++++++++++++++++++++++- 5 files changed, 452 insertions(+), 499 deletions(-) delete mode 100644 arch/arm/mach-ux500/board-mop500-regulators.c delete mode 100644 arch/arm/mach-ux500/board-mop500-regulators.h
arch/arm/mach-ux500/Makefile +1 -2
@@ -5,8 +5,7 @@ obj-y := cpu.o id.o pm.o obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o -obj-$(CONFIG_MACH_MOP500) += board-mop500-regulators.o \ - board-mop500-audio.o +obj-$(CONFIG_MACH_MOP500) += board-mop500-audio.o obj-$(CONFIG_SMP) += platsmp.o obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o
arch/arm/mach-ux500/board-mop500-regulators.c deleted +0 -465
465 lines not on this page · raw message
arch/arm/mach-ux500/board-mop500-regulators.h deleted +0 -16
@@ -1,16 +0,0 @@ -/* -* Copyright (C) ST-Ericsson SA 2010 -* -* License Terms: GNU General Public License v2 -* -* Author: Bengt Jonsson <[email protected]> for ST-Ericsson -* -* MOP500 board specific initialization for regulators -*/ - -#ifndef __BOARD_MOP500_REGULATORS_H -#define __BOARD_MOP500_REGULATORS_H - -extern struct ab8500_regulator_platform_data ab8500_regulator_plat_data; - -#endif
arch/arm/mach-ux500/cpu-db8500.c +0 -2
@@ -28,13 +28,11 @@#include "setup.h" -#include "board-mop500-regulators.h" #include "board-mop500.h" #include "db8500-regs.h" #include "id.h" static struct ab8500_platform_data ab8500_platdata = { - .regulator = &ab8500_regulator_plat_data, };static struct prcmu_pdata db8500_prcmu_pdata = {
drivers/regulator/ab8500-ext.c +451 -14
483 lines not on this page · raw message
Signature · 1 line
2.4.11
Mark Brown
maintainerPATCH 2/11 ARM: ux500: move ab8500_regulator_plat_data into driver
Quoted 5 lines · Linus Walleij
From: Arnd Bergmann <[email protected]>
There is only one instance of
ab8500_regulator_platform_data, and it's safe to assume we won't ever merge another one, so it's rather pointless to pass it through multiple levels of platform data pointers.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160705/9d225757/attachment.sig>
PATCH 3/11 ASoC: ab8500-codec: remove platform data based probe
In reply to Linus WalleijFrom: Arnd Bergmann <[email protected]>
The ux500 platform hasn't used board files for a long time, and nothing defines a ab8500_codec_platform_data, so we can just remove the probing based on that and always use device tree properties directly.
---
Mark: if this makes sense to you, please provide an ACK so Arnd can merge this cleanup.
--- sound/soc/codecs/ab8500-codec.c | 33 ++++----------------------------- 1 file changed, 4 insertions(+), 29 deletions(-)
sound/soc/codecs/ab8500-codec.c +4 -29
@@ -2464,45 +2464,20 @@ static int ab8500_codec_probe(struct snd_soc_codec *codec)struct device *dev = codec->dev;struct device_node *np = dev->of_node;struct ab8500_codec_drvdata *drvdata =dev_get_drvdata (dev); -struct ab8500_platform_data *pdata; +struct ab8500_codec_platform_data codec_pdata;struct filter_control *fc;int status;dev_dbg (dev,"%s: Enter.\n" , __func__); -/* Setup AB8500 according to board-settings */ - pdata =dev_get_platdata (dev->parent); +ab8500_codec_of_probe (dev, np, &codec_pdata); -if (np) { -if (!pdata) - pdata =devm_kzalloc (dev, -sizeof (struct ab8500_platform_data ), -GFP_KERNEL ); - -if (pdata && !pdata->codec) - pdata->codec - =devm_kzalloc (dev, -sizeof (struct ab8500_codec_platform_data ), -GFP_KERNEL ); - -if (!(pdata && pdata->codec)) -return -ENOMEM ; - -ab8500_codec_of_probe (dev, np, pdata->codec); - - }else { -if (!(pdata && pdata->codec)) { -dev_err (dev,"No codec platform data or DT found\n" ); -return -EINVAL ; - } - } - - status =ab8500_audio_setup_mics (codec, &pdata->codec->amics); + status =ab8500_audio_setup_mics (codec, &codec_pdata.amics);if (status <0 ) {pr_err ("%s: Failed to setup mics (%d)!\n" , __func__, status);return status; } - status =ab8500_audio_set_ear_cmv (codec, pdata->codec->ear_cmv); + status =ab8500_audio_set_ear_cmv (codec, codec_pdata.ear_cmv);if (status <0 ) {pr_err ("%s: Failed to set earpiece CM-voltage (%d)!\n" , __func__, status);
Signature · 1 line
2.4.11
Mark Brown
maintainerPATCH 3/11 ASoC: ab8500-codec: remove platform data based probe
Quoted 6 lines · Linus Walleij
From: Arnd Bergmann <[email protected]>
The ux500 platform hasn't used board files for a long time, and nothing defines a
ab8500_codec_platform_data, so we can just remove the probing based on that and always use device tree properties directly.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160705/2bee59bf/attachment.sig>
Mark Brown
maintainerPATCH 3/11 ASoC: ab8500-codec: remove platform data based probe
In reply to Linus WalleijQuoted 2 lines · Linus Walleij
Mark: if this makes sense to you, please provide an ACK so Arnd can merge this cleanup.
I'm still not clear what dependency this has on anything elsein the
series.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160705/59e11437/attachment.sig>
PATCH 3/11 ASoC: ab8500-codec: remove platform data based probe
Quoted 7 lines · Mark Brown
Quoted 2 lines · Linus Walleij
Mark: if this makes sense to you, please provide an ACK so Arnd can merge this cleanup.
I'm still not clear what dependency this has on anything elsein the series.
None whatsoever if I'm reading it right. The series also compiles fine without it.
Do you prefer to apply it to the ASoC tree? I can drop it from this series.
Yours,
Linus Walleij
PATCH 3/11 ASoC: ab8500-codec: remove platform data based probe
Quoted 6 lines · CEST Linus Walleij
Quoted 5 lines · Mark Brown
Quoted 2 lines · Linus Walleij
Mark: if this makes sense to you, please provide an ACK so Arnd can merge this cleanup.
Quoted 8 lines
Quoted 2 lines
I'm still not clear what dependency this has on anything elsein the series.
None whatsoever if I'm reading it right. The series also compiles fine without it.
Do you prefer to apply it to the ASoC tree? I can drop it from this series.
I was originally planning to drop the entire ab8500_platform_data structure and ab8500_codec_platform_data, which requires this change, but from all I can see are right that in the current version of the series that is not required.
Arnd
Mark Brown
maintainerPATCH 3/11 ASoC: ab8500-codec: remove platform data based probe
In reply to Linus WalleijQuoted 2 lines · Linus Walleij
Do you prefer to apply it to the ASoC tree? I can drop it from this series.
In general yes but it's also that if it looks like there should be some dependency due to it being a series and I can't see one then that makes me think I've missed something when reviewing and need to check. Anyway:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160707/bc6687c3/attachment.sig>
PATCH 4/11 mfd: db8500 stop passing around platform data
In reply to Linus WalleijFrom: Arnd Bergmann <[email protected]>
Except for the constant DB8500_PRCMU_FW_VERSION_OFFSET number, nothing is ever passed through the platform data and used in a driver, so we can simply stop passing it around.
---
Hi Lee, Arnd probably wants to pull this in for v4.8 so your ACK would be appreciated so it can be funneled through ARM SoC. I don't think it could possibly collide with anything in your
tree: I checked with git log on these files in linux-next and it seems clear.
--- arch/arm/mach-ux500/cpu-db8500.c | 17 ++-------------- arch/arm/mach-ux500/setup.h | 1 - drivers/mfd/ab8500-core.c | 4 ---- drivers/mfd/ab8500-sysctrl.c | 34 ------------------------------- drivers/mfd/db8500-prcmu.c | 10 +++------ include/linux/mfd/abx500/ab8500-sysctrl.h | 6 ------ include/linux/mfd/dbx500-prcmu.h | 10 --------- 7 files changed, 5 insertions(+), 77 deletions(-)
arch/arm/mach-ux500/cpu-db8500.c +2 -15
@@ -16,8 +16,6 @@#include <linux/irq.h> #include <linux/platform_device.h> #include <linux/io.h> -#include <linux/mfd/abx500/ab8500.h> -#include <linux/mfd/dbx500-prcmu.h> #include <linux/of.h> #include <linux/of_platform.h> #include <linux/perf/arm_pmu.h>
@@ -32,15 +30,6 @@#include "db8500-regs.h" #include "id.h" -static struct ab8500_platform_data ab8500_platdata = { -}; - -static struct prcmu_pdata db8500_prcmu_pdata = { - .ab_platdata = &ab8500_platdata, - .version_offset =DB8500_PRCMU_FW_VERSION_OFFSET , - .legacy_offset =DB8500_PRCMU_LEGACY_OFFSET , -}; -static void __init u8500_map_io (void ) {debug_ll_io_init ();
@@ -109,8 +98,7 @@ static struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {OF_DEV_AUXDATA ("stericsson,ux500-msp-i2s" ,0x80125000 ,"ux500-msp-i2s.3" , &msp3_platform_data),/* Requires non-DT:able platform data. */ -OF_DEV_AUXDATA ("stericsson,db8500-prcmu" ,0x80157000 ,"db8500-prcmu" , - &db8500_prcmu_pdata), +OF_DEV_AUXDATA ("stericsson,db8500-prcmu" ,0x80157000 ,"db8500-prcmu" ,NULL ),OF_DEV_AUXDATA ("stericsson,ux500-cryp" ,0xa03cb000 ,"cryp1" ,NULL ),OF_DEV_AUXDATA ("stericsson,ux500-hash" ,0xa03c2000 ,"hash1" ,NULL ), OF_DEV_AUXDATA("stericsson,snd-soc-mop500", 0, "snd-soc-mop500.0",
@@ -119,8 +107,7 @@ static struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = { };static struct of_dev_auxdata u8540_auxdata_lookup[]__initdata = { -OF_DEV_AUXDATA ("stericsson,db8500-prcmu" ,0x80157000 ,"db8500-prcmu" , - &db8500_prcmu_pdata), +OF_DEV_AUXDATA ("stericsson,db8500-prcmu" ,0x80157000 ,"db8500-prcmu" ,NULL ), {}, };
arch/arm/mach-ux500/setup.h +0 -1
@@ -13,7 +13,6 @@#include <asm/mach/arch.h> #include <linux/init.h> -#include <linux/mfd/abx500/ab8500.h> void ux500_restart (enum reboot_mode mode,const char *cmd);
drivers/mfd/ab8500-core.c +0 -4
@@ -1087,7 +1087,6 @@ static int ab8500_probe(struct platform_device *pdev)"Vbus Detect (USB)" ,"USB ID Detect" , "UART Factory Mode Detect"}; -struct ab8500_platform_data *plat =dev_get_platdata (&pdev->dev);const struct platform_device_id *platid =platform_get_device_id (pdev);enum ab8500_version version =AB8500_VERSION_UNDEFINED ;struct device_node *np = pdev->dev.of_node;
@@ -1219,9 +1218,6 @@ static int ab8500_probe(struct platform_device *pdev)pr_cont ("None\n" ); } -if (plat && plat->init) - plat->init (ab8500); -if (is_ab9540 (ab8500)) { ret =get_register_interruptible (ab8500,AB8500_CHARGER ,AB8500_CH_USBCH_STAT1_REG , &value);
drivers/mfd/ab8500-sysctrl.c +0 -34
@@ -127,45 +127,11 @@ EXPORT_SYMBOL(ab8500_sysctrl_write);static int ab8500_sysctrl_probe (struct platform_device *pdev) { -struct ab8500 *ab8500 =dev_get_drvdata (pdev->dev.parent); -struct ab8500_platform_data *plat; -struct ab8500_sysctrl_platform_data *pdata; - - plat =dev_get_platdata (pdev->dev.parent); - -if (!plat) -return -EINVAL ; - sysctrl_dev = &pdev->dev;if (!pm_power_off) pm_power_off = ab8500_power_off; - pdata = plat->sysctrl; -if (pdata) { -int last, ret, i, j; - -if (is_ab8505 (ab8500)) - last =AB8500_SYSCLKREQ4RFCLKBUF ; -else - last =AB8500_SYSCLKREQ8RFCLKBUF ; - -for (i =AB8500_SYSCLKREQ1RFCLKBUF ; i <= last; i++) { - j = i -AB8500_SYSCLKREQ1RFCLKBUF ; - ret =ab8500_sysctrl_write (i,0xff , - pdata->initial_req_buf_config[j]); -dev_dbg (&pdev->dev, -"Setting SysClkReq%dRfClkBuf 0x%X\n" , - j +1 , - pdata->initial_req_buf_config[j]); -if (ret <0 ) { -dev_err (&pdev->dev, -"Can't set sysClkReq%dRfClkBuf: %d\n" , - j +1 , ret); - } - } - } -return 0 ; }
drivers/mfd/db8500-prcmu.c +3 -7
@@ -3094,8 +3094,7 @@ static void db8500_prcmu_update_cpufreq(void) } } -static int db8500_prcmu_register_ab8500 (struct device *parent, -struct ab8500_platform_data *pdata) +static int db8500_prcmu_register_ab8500 (struct device *parent) {struct device_node *np;struct resource ab8500_resource;
@@ -3103,8 +3102,6 @@ static int db8500_prcmu_register_ab8500(struct device *parent, .name = "ab8500-core", .of_compatible = "stericsson,ab8500", .id = AB8500_VERSION_AB8500, - .platform_data = pdata, - .pdata_size = sizeof(struct ab8500_platform_data), .resources = &ab8500_resource, .num_resources = 1, };
@@ -3133,7 +3130,6 @@ static int db8500_prcmu_register_ab8500(struct device *parent,static int db8500_prcmu_probe (struct platform_device *pdev) {struct device_node *np = pdev->dev.of_node; -struct prcmu_pdata *pdata =dev_get_platdata (&pdev->dev);int irq =0 , err =0 ;struct resource *res;
@@ -3149,7 +3145,7 @@ static int db8500_prcmu_probe(struct platform_device *pdev)return -ENOMEM ; }init_prcm_registers (); -dbx500_fw_version_init (pdev, pdata->version_offset); +dbx500_fw_version_init (pdev,DB8500_PRCMU_FW_VERSION_OFFSET ); res =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"prcmu-tcdm" );if (!res) {dev_err (&pdev->dev,"no prcmu tcdm region provided\n" );
@@ -3204,7 +3200,7 @@ static int db8500_prcmu_probe(struct platform_device *pdev) } } - err =db8500_prcmu_register_ab8500 (&pdev->dev, pdata->ab_platdata); + err =db8500_prcmu_register_ab8500 (&pdev->dev);if (err) {mfd_remove_devices (&pdev->dev);pr_err ("prcmu: Failed to add ab8500 subdevice\n" );
include/linux/mfd/abx500/ab8500-sysctrl.h +0 -6
@@ -37,12 +37,6 @@ static inline int ab8500_sysctrl_clear(u16 reg, u8 bits)return ab8500_sysctrl_write (reg, bits,0 ); } -/* Configuration data for SysClkReq1RfClkBuf - SysClkReq8RfClkBuf */ -struct ab8500_sysctrl_platform_data { -u8 initial_req_buf_config[8 ]; -u16 (*reboot_reason_code)(const char *cmd); -}; -/* Registers */ #define AB8500_TURNONSTATUS 0x100#define AB8500_RESETSTATUS 0x101
include/linux/mfd/dbx500-prcmu.h +0 -10
@@ -178,16 +178,6 @@ enum ddr_pwrst {#define DB8500_PRCMU_LEGACY_OFFSET 0xDD4 -struct prcmu_pdata -{ -bool enable_set_ddr_opp; -bool enable_ape_opp_100_voltage; -struct ab8500_platform_data *ab_platdata; -u32 version_offset; -u32 legacy_offset; -u32 adt_offset; -}; -#define PRCMU_FW_PROJECT_U8500 2#define PRCMU_FW_PROJECT_U8400 3#define PRCMU_FW_PROJECT_U9500 4/* Customer specific */
Signature · 1 line
2.4.11
PATCH 4/11 mfd: db8500 stop passing around platform data
Quoted 9 lines · Linus Walleij
From: Arnd Bergmann <[email protected]>
Except for the constant
DB8500_PRCMU_FW_VERSION_OFFSETnumber, nothing is ever passed through the platform data and used in a driver, so we can simply stop passing it around.Cc Lee Jones <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>Signed-off-by Linus Walleij <[email protected]>
Quoted 6 lines
---
Hi Lee, Arnd probably wants to pull this in for v4.8 so your ACK would be appreciated so it can be funneled through ARM SoC. I don't think it could possibly collide with anything in your
tree: I checked with git log on these files in linux-next and it seems clear.
Lee is this something you could ACK?
Yours,
Linus Walleij
PATCH 4/11 mfd: db8500 stop passing around platform data
In reply to Linus WalleijQuoted 15 lines · Linus Walleij
From: Arnd Bergmann <[email protected]>
Except for the constant
DB8500_PRCMU_FW_VERSION_OFFSETnumber, nothing is ever passed through the platform data and used in a driver, so we can simply stop passing it around.Cc Lee Jones <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>Signed-off-by Linus Walleij <[email protected]>---
Hi Lee, Arnd probably wants to pull this in for v4.8 so your ACK would be appreciated so it can be funneled through ARM SoC. I don't think it could possibly collide with anything in your
tree: I checked with git log on these files in linux-next and it seems clear.
Quoted 9 lines
--- arch/arm/mach-ux500/cpu-db8500.c | 17 ++-------------- arch/arm/mach-ux500/setup.h | 1 - drivers/mfd/ab8500-core.c | 4 ---- drivers/mfd/ab8500-sysctrl.c | 34 ------------------------------- drivers/mfd/db8500-prcmu.c | 10 +++------ include/linux/mfd/abx500/ab8500-sysctrl.h | 6 ------ include/linux/mfd/dbx500-prcmu.h | 10 --------- 7 files changed, 5 insertions(+), 77 deletions(-)
Without review (because I trust you both to do the right thing):
Quoted 220 lines
arch/arm/mach-ux500/cpu-db8500.c +2
-15@@ -16,8 +16,6 @@#include <linux/irq.h> #include <linux/platform_device.h> #include <linux/io.h> -#include <linux/mfd/abx500/ab8500.h> -#include <linux/mfd/dbx500-prcmu.h> #include <linux/of.h> #include <linux/of_platform.h> #include <linux/perf/arm_pmu.h> @@ -32,15 +30,6 @@#include "db8500-regs.h" #include "id.h" -static struct ab8500_platform_data ab8500_platdata = { -}; - -static struct prcmu_pdata db8500_prcmu_pdata = { - .ab_platdata = &ab8500_platdata, - .version_offset =DB8500_PRCMU_FW_VERSION_OFFSET , - .legacy_offset =DB8500_PRCMU_LEGACY_OFFSET , -}; -static void __init u8500_map_io (void ) {debug_ll_io_init ();@@ -109,8 +98,7 @@ static struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {OF_DEV_AUXDATA ("stericsson,ux500-msp-i2s" ,0x80125000 ,"ux500-msp-i2s.3" , &msp3_platform_data),/* Requires non-DT:able platform data. */ -OF_DEV_AUXDATA ("stericsson,db8500-prcmu" ,0x80157000 ,"db8500-prcmu" , - &db8500_prcmu_pdata), +OF_DEV_AUXDATA ("stericsson,db8500-prcmu" ,0x80157000 ,"db8500-prcmu" ,NULL ),OF_DEV_AUXDATA ("stericsson,ux500-cryp" ,0xa03cb000 ,"cryp1" ,NULL ),OF_DEV_AUXDATA ("stericsson,ux500-hash" ,0xa03c2000 ,"hash1" ,NULL ), OF_DEV_AUXDATA("stericsson,snd-soc-mop500", 0, "snd-soc-mop500.0",@@ -119,8 +107,7 @@ static struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = { };static struct of_dev_auxdata u8540_auxdata_lookup[]__initdata = { -OF_DEV_AUXDATA ("stericsson,db8500-prcmu" ,0x80157000 ,"db8500-prcmu" , - &db8500_prcmu_pdata), +OF_DEV_AUXDATA ("stericsson,db8500-prcmu" ,0x80157000 ,"db8500-prcmu" ,NULL ), {}, };arch/arm/mach-ux500/setup.h +0
-1@@ -13,7 +13,6 @@#include <asm/mach/arch.h> #include <linux/init.h> -#include <linux/mfd/abx500/ab8500.h> void ux500_restart (enum reboot_mode mode,const char *cmd);drivers/mfd/ab8500-core.c +0
-4@@ -1087,7 +1087,6 @@ static int ab8500_probe(struct platform_device *pdev)"Vbus Detect (USB)" ,"USB ID Detect" , "UART Factory Mode Detect"}; -struct ab8500_platform_data *plat =dev_get_platdata (&pdev->dev);const struct platform_device_id *platid =platform_get_device_id (pdev);enum ab8500_version version =AB8500_VERSION_UNDEFINED ;struct device_node *np = pdev->dev.of_node;@@ -1219,9 +1218,6 @@ static int ab8500_probe(struct platform_device *pdev)pr_cont ("None\n" ); } -if (plat && plat->init) - plat->init (ab8500); -if (is_ab9540 (ab8500)) { ret =get_register_interruptible (ab8500,AB8500_CHARGER ,AB8500_CH_USBCH_STAT1_REG , &value);drivers/mfd/ab8500-sysctrl.c +0
-34@@ -127,45 +127,11 @@ EXPORT_SYMBOL(ab8500_sysctrl_write);static int ab8500_sysctrl_probe (struct platform_device *pdev) { -struct ab8500 *ab8500 =dev_get_drvdata (pdev->dev.parent); -struct ab8500_platform_data *plat; -struct ab8500_sysctrl_platform_data *pdata; - - plat =dev_get_platdata (pdev->dev.parent); - -if (!plat) -return -EINVAL ; - sysctrl_dev = &pdev->dev;if (!pm_power_off) pm_power_off = ab8500_power_off; - pdata = plat->sysctrl; -if (pdata) { -int last, ret, i, j; - -if (is_ab8505 (ab8500)) - last =AB8500_SYSCLKREQ4RFCLKBUF ; -else - last =AB8500_SYSCLKREQ8RFCLKBUF ; - -for (i =AB8500_SYSCLKREQ1RFCLKBUF ; i <= last; i++) { - j = i -AB8500_SYSCLKREQ1RFCLKBUF ; - ret =ab8500_sysctrl_write (i,0xff , - pdata->initial_req_buf_config[j]); -dev_dbg (&pdev->dev, -"Setting SysClkReq%dRfClkBuf 0x%X\n" , - j +1 , - pdata->initial_req_buf_config[j]); -if (ret <0 ) { -dev_err (&pdev->dev, -"Can't set sysClkReq%dRfClkBuf: %d\n" , - j +1 , ret); - } - } - } -return 0 ; }drivers/mfd/db8500-prcmu.c +3
-7@@ -3094,8 +3094,7 @@ static void db8500_prcmu_update_cpufreq(void) } } -static int db8500_prcmu_register_ab8500 (struct device *parent, -struct ab8500_platform_data *pdata) +static int db8500_prcmu_register_ab8500 (struct device *parent) {struct device_node *np;struct resource ab8500_resource;@@ -3103,8 +3102,6 @@ static int db8500_prcmu_register_ab8500(struct device *parent, .name = "ab8500-core", .of_compatible = "stericsson,ab8500", .id = AB8500_VERSION_AB8500, - .platform_data = pdata, - .pdata_size = sizeof(struct ab8500_platform_data), .resources = &ab8500_resource, .num_resources = 1, };@@ -3133,7 +3130,6 @@ static int db8500_prcmu_register_ab8500(struct device *parent,static int db8500_prcmu_probe (struct platform_device *pdev) {struct device_node *np = pdev->dev.of_node; -struct prcmu_pdata *pdata =dev_get_platdata (&pdev->dev);int irq =0 , err =0 ;struct resource *res;@@ -3149,7 +3145,7 @@ static int db8500_prcmu_probe(struct platform_device *pdev)return -ENOMEM ; }init_prcm_registers (); -dbx500_fw_version_init (pdev, pdata->version_offset); +dbx500_fw_version_init (pdev,DB8500_PRCMU_FW_VERSION_OFFSET ); res =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"prcmu-tcdm" );if (!res) {dev_err (&pdev->dev,"no prcmu tcdm region provided\n" );@@ -3204,7 +3200,7 @@ static int db8500_prcmu_probe(struct platform_device *pdev) } } - err =db8500_prcmu_register_ab8500 (&pdev->dev, pdata->ab_platdata); + err =db8500_prcmu_register_ab8500 (&pdev->dev);if (err) {mfd_remove_devices (&pdev->dev);pr_err ("prcmu: Failed to add ab8500 subdevice\n" );include/linux/mfd/abx500/ab8500-sysctrl.h +0
-6@@ -37,12 +37,6 @@ static inline int ab8500_sysctrl_clear(u16 reg, u8 bits)return ab8500_sysctrl_write (reg, bits,0 ); } -/* Configuration data for SysClkReq1RfClkBuf - SysClkReq8RfClkBuf */ -struct ab8500_sysctrl_platform_data { -u8 initial_req_buf_config[8 ]; -u16 (*reboot_reason_code)(const char *cmd); -}; -/* Registers */ #define AB8500_TURNONSTATUS 0x100#define AB8500_RESETSTATUS 0x101include/linux/mfd/dbx500-prcmu.h +0
-10@@ -178,16 +178,6 @@ enum ddr_pwrst {#define DB8500_PRCMU_LEGACY_OFFSET 0xDD4 -struct prcmu_pdata -{ -bool enable_set_ddr_opp; -bool enable_ape_opp_100_voltage; -struct ab8500_platform_data *ab_platdata; -u32 version_offset; -u32 legacy_offset; -u32 adt_offset; -}; -#define PRCMU_FW_PROJECT_U8500 2#define PRCMU_FW_PROJECT_U8400 3#define PRCMU_FW_PROJECT_U9500 4/* Customer specific */
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org ? Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
PATCH 5/11 ARM: ux500: move l2x0 init to .init_irq
In reply to Linus WalleijFrom: Arnd Bergmann <[email protected]>
The generic IRQ init function also enables the l2 cache implicitly when the machine descriptor sets an .l2c_aux_mask.
Let's use that on ux500 and remove the ux500_l2x0_init() along with the cpu_is_u8500_family checks.
--- arch/arm/mach-ux500/cache-l2x0.c | 8 +------- arch/arm/mach-ux500/cpu-db8500.c | 3 ++- arch/arm/mach-ux500/cpu.c | 1 + arch/arm/mach-ux500/setup.h | 3 +++ 4 files changed, 7 insertions(+), 8 deletions(-)
arch/arm/mach-ux500/cache-l2x0.c +1 -7
@@ -51,17 +51,11 @@ static void ux500_l2c310_write_sec(unsigned long val, unsigned reg)*/ } -static int __init ux500_l2x0_init (void ) +void __init ux500_l2x0_init (void ) { -/* Multiplatform guard */ -if (!((cpu_is_u8500_family () ||cpu_is_ux540_family ()))) -return -ENODEV ; -/* Unlock before init */ ux500_l2x0_unlock (); outer_cache.write_sec = ux500_l2c310_write_sec; -l2x0_of_init (0 , ~0 );return 0 ; } -early_initcall (ux500_l2x0_init);
arch/arm/mach-ux500/cpu-db8500.c +2 -1
@@ -141,10 +141,11 @@ static const char * stericsson_dt_platform_compat[] = { };DT_MACHINE_START (U8500_DT ,"ST-Ericsson Ux5x0 platform (Device Tree Support)" ) + .l2c_aux_val = 0, + .l2c_aux_mask = ~0, .map_io = u8500_map_io, .init_irq = ux500_init_irq, .init_machine = u8500_init_machine, - .init_late = NULL, .dt_compat = stericsson_dt_platform_compat, .restart = ux500_restart,MACHINE_END
arch/arm/mach-ux500/cpu.c +1 -0
@@ -65,6 +65,7 @@ void __init ux500_init_irq(void) }prcmu_early_init (r.start, r.end-r.start);ux500_pm_init (r.start, r.end-r.start); +ux500_l2x0_init ();/* * Init clocks here so that they are available for system timer
arch/arm/mach-ux500/setup.h +3 -0
@@ -14,6 +14,9 @@#include <asm/mach/arch.h> #include <linux/init.h> + +void ux500_l2x0_init (void ); +void ux500_restart (enum reboot_mode mode,const char *cmd);void __init ux500_setup_id (void );
Signature · 1 line
2.4.11
PATCH 6/11 ARM: ux500: use CLK_OF_DECLARE()
In reply to Linus WalleijFrom: Arnd Bergmann <[email protected]>
The ux500 DT support predates the CLK_OF_DECLARE macro and calls directly into the clk driver from platform code.
Converting this to CLK_OF_DECLARE makes the code much nicer and similar to how modern platforms do it today. It also removes the last user of cpu_is_u8500_family() etc.
--- MAINTAINERS | 1 - arch/arm/mach-ux500/cpu.c | 12 ------------ drivers/clk/ux500/u8500_of_clk.c | 16 ++-------------- drivers/clk/ux500/u8540_clk.c | 16 ++-------------- drivers/clk/ux500/u9540_clk.c | 4 ++-- include/linux/platform_data/clk-ux500.h | 17 ----------------- 6 files changed, 6 insertions(+), 60 deletions(-) delete mode 100644 include/linux/platform_data/clk-ux500.h
MAINTAINERS +0 -1
@@ -1821,7 +1821,6 @@ L: linux-arm-kernel at lists.infradead.org (moderated for non-subscribers) T: git git://git.linaro.org/people/ulfh/clk.git S: Maintained F: drivers/clk/ux500/ -F: include/linux/platform_data/clk-ux500.h ARM/VERSATILE EXPRESS PLATFORM M: Liviu Dudau <[email protected]>
arch/arm/mach-ux500/cpu.c +0 -12
@@ -19,7 +19,6 @@#include <linux/irq.h> #include <linux/irqchip.h> #include <linux/irqchip/arm-gic.h> -#include <linux/platform_data/clk-ux500.h> #include <linux/platform_data/arm-ux500-pm.h> #include <asm/mach/map.h>
@@ -66,17 +65,6 @@ void __init ux500_init_irq(void)prcmu_early_init (r.start, r.end-r.start);ux500_pm_init (r.start, r.end-r.start);ux500_l2x0_init (); - -/* -* Init clocks here so that they are available for system timer -* initialization. -*/ -if (cpu_is_u8500_family ()) -u8500_clk_init (); -else if (cpu_is_u9540 ()) -u9540_clk_init (); -else if (cpu_is_u8540 ()) -u8540_clk_init (); }static const char *__init ux500_get_machine (void )
drivers/clk/ux500/u8500_of_clk.c +2 -14
@@ -11,7 +11,6 @@#include <linux/of_address.h> #include <linux/clk-provider.h> #include <linux/mfd/dbx500-prcmu.h> -#include <linux/platform_data/clk-ux500.h> #include "clk.h" #define PRCC_NUM_PERIPH_CLUSTERS 6
@@ -48,11 +47,6 @@ static struct clk *ux500_twocell_get(struct of_phandle_args *clkspec,return PRCC_SHOW (clk_data, base, bit); } -static const struct of_device_id u8500_clk_of_match[] = { - { .compatible ="stericsson,u8500-clks" , }, - { }, -}; -/* CLKRST4 is missing making it hard to index things */ enum clkrst_index {CLKRST1_INDEX =0 ,
@@ -63,22 +57,15 @@ enum clkrst_index { CLKRST_MAX, }; -void u8500_clk_init (void ) +static void u8500_clk_init (struct device_node *np) {struct prcmu_fw_version *fw_version; -struct device_node *np =NULL ;struct device_node *child =NULL ;const char *sgaclk_parent =NULL ;struct clk *clk, *rtc_clk, *twd_clk;u32 bases[CLKRST_MAX ];int i; -if (of_have_populated_dt ()) - np =of_find_matching_node (NULL , u8500_clk_of_match); -if (!np) { -pr_err ("Either DT or U8500 Clock node not found\n" ); -return ; - }for (i =0 ; i <ARRAY_SIZE (bases); i++) {struct resource r;
@@ -573,3 +560,4 @@ void u8500_clk_init(void)of_clk_add_provider (child, of_clk_src_simple_get, twd_clk); } } +CLK_OF_DECLARE (u8500_clks,"stericsson,u8500-clks" , u8500_clk_init);
drivers/clk/ux500/u8540_clk.c +2 -14
@@ -12,14 +12,8 @@#include <linux/clkdev.h> #include <linux/clk-provider.h> #include <linux/mfd/dbx500-prcmu.h> -#include <linux/platform_data/clk-ux500.h> #include "clk.h" -static const struct of_device_id u8540_clk_of_match[] = { - { .compatible ="stericsson,u8540-clks" , }, - { } -}; -/* CLKRST4 is missing making it hard to index things */ enum clkrst_index {CLKRST1_INDEX =0 ,
@@ -30,19 +24,12 @@ enum clkrst_index { CLKRST_MAX, }; -void u8540_clk_init (void ) +static void u8540_clk_init (struct device_node *np) {struct clk *clk; -struct device_node *np =NULL ;u32 bases[CLKRST_MAX ];int i; -if (of_have_populated_dt ()) - np =of_find_matching_node (NULL , u8540_clk_of_match); -if (!np) { -pr_err ("Either DT or U8540 Clock node not found\n" ); -return ; - }for (i =0 ; i <ARRAY_SIZE (bases); i++) {struct resource r;
@@ -607,3 +594,4 @@ void u8540_clk_init(void) bases[CLKRST6_INDEX], BIT(0), CLK_SET_RATE_GATE);clk_register_clkdev (clk,NULL ,"rng" ); } +CLK_OF_DECLARE (u8540_clks,"stericsson,u8540-clks" , u8540_clk_init);
drivers/clk/ux500/u9540_clk.c +2 -2
@@ -9,10 +9,10 @@#include <linux/clk-provider.h> #include <linux/mfd/dbx500-prcmu.h> -#include <linux/platform_data/clk-ux500.h> #include "clk.h" -void u9540_clk_init (void ) +static void u9540_clk_init (struct device_node *np) {/* register clocks here */ } +CLK_OF_DECLARE (u9540_clks,"stericsson,u9540-clks" , u9540_clk_init);
include/linux/platform_data/clk-ux500.h deleted +0 -17
@@ -1,17 +0,0 @@ -/* -* Clock definitions for ux500 platforms -* -* Copyright (C) 2012 ST-Ericsson SA -* Author: Ulf Hansson <[email protected]> -* -* License terms: GNU General Public License (GPL) version 2 -*/ - -#ifndef __CLK_UX500_H -#define __CLK_UX500_H - -void u8500_clk_init (void ); -void u9540_clk_init (void ); -void u8540_clk_init (void ); - -#endif /* __CLK_UX500_H */
Signature · 1 line
2.4.11
PATCH 7/11 ARM: ux500: remove cpu_is_u* helpers
In reply to Linus WalleijFrom: Arnd Bergmann <[email protected]>
These functions are all unused now and can be removed.
--- arch/arm/mach-ux500/id.h | 107 ----------------------------------------------- 1 file changed, 107 deletions(-)
arch/arm/mach-ux500/id.h +0 -107
@@ -32,113 +32,6 @@ static inline unsigned int __attribute_const__ dbx500_revision(void) return dbx500_id.revision; } -/* -* SOCs -*/ - -static inline bool __attribute_const__ cpu_is_u8500(void) -{ -return dbx500_partnumber () ==0x8500 ; -} - -static inline bool __attribute_const__ cpu_is_u8520(void) -{ -return dbx500_partnumber () ==0x8520 ; -} - -static inline bool cpu_is_u8500_family (void ) -{ -return cpu_is_u8500 () ||cpu_is_u8520 (); -} - -static inline bool __attribute_const__ cpu_is_u9540(void) -{ -return dbx500_partnumber () ==0x9540 ; -} - -static inline bool __attribute_const__ cpu_is_u8540(void) -{ -return dbx500_partnumber () ==0x8540 ; -} - -static inline bool __attribute_const__ cpu_is_u8580(void) -{ -return dbx500_partnumber () ==0x8580 ; -} - -static inline bool cpu_is_ux540_family (void ) -{ -return cpu_is_u9540 () ||cpu_is_u8540 () ||cpu_is_u8580 (); -} - -/* -* 8500 revisions -*/ - -static inline bool __attribute_const__ cpu_is_u8500ed(void) -{ -return cpu_is_u8500 () &&dbx500_revision () ==0x00 ; -} - -static inline bool __attribute_const__ cpu_is_u8500v1(void) -{ -return cpu_is_u8500 () && (dbx500_revision () &0xf0 ) ==0xA0 ; -} - -static inline bool __attribute_const__ cpu_is_u8500v10(void) -{ -return cpu_is_u8500 () &&dbx500_revision () ==0xA0 ; -} - -static inline bool __attribute_const__ cpu_is_u8500v11(void) -{ -return cpu_is_u8500 () &&dbx500_revision () ==0xA1 ; -} - -static inline bool __attribute_const__ cpu_is_u8500v2(void) -{ -return cpu_is_u8500 () && ((dbx500_revision () &0xf0 ) ==0xB0 ); -} - -static inline bool cpu_is_u8500v20 (void ) -{ -return cpu_is_u8500 () && (dbx500_revision () ==0xB0 ); -} - -static inline bool cpu_is_u8500v21 (void ) -{ -return cpu_is_u8500 () && (dbx500_revision () ==0xB1 ); -} - -static inline bool cpu_is_u8500v22 (void ) -{ -return cpu_is_u8500 () && (dbx500_revision () ==0xB2 ); -} - -static inline bool cpu_is_u8500v20_or_later (void ) -{ -return (cpu_is_u8500 () && !cpu_is_u8500v10 () && !cpu_is_u8500v11 ()); -} - -/* -* 8540 revisions -*/ - -static inline bool __attribute_const__ cpu_is_u8540v10(void) -{ -return cpu_is_u8540 () &&dbx500_revision () ==0xA0 ; -} - -static inline bool __attribute_const__ cpu_is_u8580v10(void) -{ -return cpu_is_u8580 () &&dbx500_revision () ==0xA0 ; -} - -static inline bool ux500_is_svp (void ) -{ -return false; -} -#define ux500_unknown_soc () BUG()#endif
Signature · 1 line
2.4.11
PATCH 8/11 ARM: ux500: consolidate soc_device code in id.c
In reply to Linus WalleijFrom: Arnd Bergmann <[email protected]>
Nothing else uses the global dbx500_asic_id structure, so we can merge the two small files that reference it into one.
--- arch/arm/mach-ux500/cache-l2x0.c | 1 - arch/arm/mach-ux500/cpu-db8500.c | 28 +--------- arch/arm/mach-ux500/cpu.c | 70 ------------------------- arch/arm/mach-ux500/id.c | 110 +++++++++++++++++++++++++++++++++++++-- arch/arm/mach-ux500/id.h | 37 ------------- arch/arm/mach-ux500/platsmp.c | 1 - arch/arm/mach-ux500/setup.h | 4 +- 7 files changed, 107 insertions(+), 144 deletions(-) delete mode 100644 arch/arm/mach-ux500/id.h
arch/arm/mach-ux500/cache-l2x0.c +0 -1
@@ -12,7 +12,6 @@#include <asm/hardware/cache-l2x0.h> #include "db8500-regs.h" -#include "id.h" static int __init ux500_l2x0_unlock (void ) {
arch/arm/mach-ux500/cpu-db8500.c +1 -27
@@ -20,7 +20,6 @@#include <linux/of_platform.h> #include <linux/perf/arm_pmu.h> #include <linux/regulator/machine.h> -#include <linux/random.h> #include <asm/mach/map.h>
@@ -60,31 +59,6 @@ static struct arm_pmu_platdata db8500_pmu_platdata = { .handle_irq = db8500_pmu_handler, }; -static const char *db8500_read_soc_id (void ) -{ -void __iomem *uid; -const char *retstr; - - uid =ioremap (U8500_BB_UID_BASE ,0x20 ); -if (!uid) -return NULL ; -/* Throw these device-specific numbers into the entropy pool */ -add_device_randomness (uid,0x14 ); - retstr =kasprintf (GFP_KERNEL ,"%08x%08x%08x%08x%08x" , -readl ((u32 *)uid+0 ), -readl ((u32 *)uid+1 ),readl ((u32 *)uid+2 ), -readl ((u32 *)uid+3 ),readl ((u32 *)uid+4 )); -iounmap (uid); -return retstr; -} - -static struct device *__init db8500_soc_device_init (void ) -{ -const char *soc_id =db8500_read_soc_id (); - -return ux500_soc_device_init (soc_id); -} -static struct of_dev_auxdata u8500_auxdata_lookup[]__initdata = {/* Requires call-back bindings. */ OF_DEV_AUXDATA ("arm,cortex-a9-pmu" ,0 ,"arm-pmu" , &db8500_pmu_platdata),
@@ -121,7 +95,7 @@ static const struct of_device_id u8500_local_bus_nodes[] = {static void __init u8500_init_machine (void ) { -struct device *parent =db8500_soc_device_init (); +struct device *parent =ux500_soc_device_init ();/* automatically probe child nodes of dbx5x0 devices */ if (of_machine_is_compatible ("st-ericsson,u8540" ))
arch/arm/mach-ux500/cpu.c +0 -70
79 lines not on this page · raw message
arch/arm/mach-ux500/id.c +105 -5
139 lines not on this page · raw message
arch/arm/mach-ux500/id.h deleted +0 -37
@@ -1,37 +0,0 @@ -/* -* Copyright (C) ST-Ericsson SA 2010 -* -* Author: Rabin Vincent <[email protected]> for ST-Ericsson -* License terms: GNU General Public License (GPL) version 2 -*/ - -#ifndef __MACH_UX500_ID -#define __MACH_UX500_ID - -/** -* struct dbx500_asic_id - fields of the ASIC ID -* @process: the manufacturing process, 0x40 is 40 nm 0x00 is "standard" -* @partnumber: hithereto 0x8500 for DB8500 -* @revision: version code in the series -*/ -struct dbx500_asic_id { -u16 partnumber; -u8 revision; -u8 process; -}; - -extern struct dbx500_asic_id dbx500_id; - -static inline unsigned int __attribute_const__ dbx500_partnumber(void) -{ -return dbx500_id.partnumber; -} - -static inline unsigned int __attribute_const__ dbx500_revision(void) -{ -return dbx500_id.revision; -} - -#define ux500_unknown_soc () BUG() - -#endif
arch/arm/mach-ux500/platsmp.c +0 -1
@@ -26,7 +26,6 @@#include "setup.h" #include "db8500-regs.h" -#include "id.h" /* Magic triggers in backup RAM */ #define UX500_CPU1_JUMPADDR_OFFSET 0x1FF4
arch/arm/mach-ux500/setup.h +1 -3
@@ -19,11 +19,9 @@ void ux500_l2x0_init(void);void ux500_restart (enum reboot_mode mode,const char *cmd); -void __init ux500_setup_id (void ); -extern void __init ux500_init_irq (void ); -extern struct device *ux500_soc_device_init (const char *soc_id); +extern struct device *ux500_soc_device_init (void );extern void ux500_cpu_die (unsigned int cpu);
Signature · 1 line
2.4.11
PATCH 9/11 ARM: ux500: call ux500_setup_id later
In reply to Linus WalleijFrom: Arnd Bergmann <[email protected]>
ux500_setup_id is currently called from u8500_map_io(), which is really early, but nothing relies on the ID any more, other than a printk message that is not really all that important to have early during boot.
If we move the call to ux500_setup_id() into ux500_soc_device_init(), that file becomes usuable almost entirely standalone, and we can kill off the u8500_map_io() callback as it just does the default debug_ll_io_init() now.
--- arch/arm/mach-ux500/cpu-db8500.c | 8 -------- arch/arm/mach-ux500/id.c | 23 ++++++++++------------- 2 files changed, 10 insertions(+), 21 deletions(-)
arch/arm/mach-ux500/cpu-db8500.c +0 -8
@@ -27,13 +27,6 @@#include "board-mop500.h" #include "db8500-regs.h" -#include "id.h" - -static void __init u8500_map_io (void ) -{ -debug_ll_io_init (); -ux500_setup_id (); -}/* * The PMU IRQ lines of two cores are wired together into a single interrupt.
@@ -117,7 +110,6 @@ static const char * stericsson_dt_platform_compat[] = {DT_MACHINE_START (U8500_DT ,"ST-Ericsson Ux5x0 platform (Device Tree Support)" ) .l2c_aux_val = 0, .l2c_aux_mask = ~0, - .map_io = u8500_map_io, .init_irq = ux500_init_irq, .init_machine = u8500_init_machine, .dt_compat = stericsson_dt_platform_compat,
arch/arm/mach-ux500/id.c +10 -13
@@ -37,21 +37,16 @@ static struct dbx500_asic_id dbx500_id;static unsigned int __init ux500_read_asicid (phys_addr_t addr) { -phys_addr_t base = addr & ~0xfff ; -struct map_desc desc = { - .virtual = (unsigned long )UX500_VIRT_ROM , - .pfn =__phys_to_pfn (base), - .length =SZ_16K , - .type =MT_DEVICE , - }; +void __iomem *virt =ioremap (addr,4 ); +unsigned int asicid; -iotable_init (&desc,1 ); +if (!virt) +return 0 ; -/* As in devicemaps_init() */ -local_flush_tlb_all (); -flush_cache_all (); + asicid =readl (virt); +iounmap (virt); -return readl (UX500_VIRT_ROM + (addr &0xfff )); +return asicid; }static void ux500_print_soc_info (unsigned int asicid)
@@ -86,7 +81,7 @@ static unsigned int partnumber(unsigned int asicid)* DB9540 0x413fc090 0xFFFFDBF4 0x009540xx */ -void __init ux500_setup_id (void ) +static void __init ux500_setup_id (void ) {unsigned int cpuid =read_cpuid_id ();unsigned int asicid =0 ;
@@ -197,6 +192,8 @@ struct device * __init ux500_soc_device_init(void)struct soc_device *soc_dev;struct soc_device_attribute *soc_dev_attr; +ux500_setup_id (); + soc_dev_attr =kzalloc (sizeof (*soc_dev_attr),GFP_KERNEL );if (!soc_dev_attr)return ERR_PTR (-ENOMEM );
Signature · 1 line
2.4.11
PATCH 10/11 ARM: ux500: move soc_id driver to drivers/soc
In reply to Linus WalleijFrom: Arnd Bergmann <[email protected]>
As the ux500 id code is basically a standalone driver, we can move it out of the arch code into drivers/soc/ux500.
This is a user-visible change, as it moves all the devices in sysfs from /sys/devices/soc0/ to /sys/devices/ and leaves the soc0 node as a separate device.
Originally the idea was to put all on-chip devices under the soc node, and ux500 was the first platform to have this device, but later platforms almost all didn't follow that pattern, so this makes the platform do the same thing as everyone else.
Since the platform is really obsolete now, I am optimistic that nothing will break after moving the devices around.
As the SoC driver no longer has access to the private header files, I'm changing the code to instead look up the address of the backupram from devicetree, which is a good idea anyway.
Finally, having a separate Kconfig symbol means the driver is now optional and could even be a loadable module rather than always being built-in if we allowed that for soc_device.
--- arch/arm/mach-ux500/Makefile | 2 +- arch/arm/mach-ux500/cpu-db8500.c | 6 +- arch/arm/mach-ux500/id.c | 213 ------------------------------------- arch/arm/mach-ux500/setup.h | 2 - drivers/soc/Kconfig | 1 + drivers/soc/Makefile | 1 + drivers/soc/ux500/Kconfig | 7 ++ drivers/soc/ux500/Makefile | 1 + drivers/soc/ux500/ux500-soc-id.c | 222 +++++++++++++++++++++++++++++++++++++++ 9 files changed, 235 insertions(+), 220 deletions(-) delete mode 100644 arch/arm/mach-ux500/id.c create mode 100644 drivers/soc/ux500/Kconfig create mode 100644 drivers/soc/ux500/Makefile create mode 100644 drivers/soc/ux500/ux500-soc-id.c
arch/arm/mach-ux500/Makefile +1 -1
@@ -2,7 +2,7 @@ # Makefile for the linux kernel, U8500 machine. # -obj-y := cpu.o id.o pm.o +obj-y := cpu.o pm.o obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o obj-$(CONFIG_MACH_MOP500) += board-mop500-audio.o
arch/arm/mach-ux500/cpu-db8500.c +2 -4
@@ -88,15 +88,13 @@ static const struct of_device_id u8500_local_bus_nodes[] = {static void __init u8500_init_machine (void ) { -struct device *parent =ux500_soc_device_init (); -/* automatically probe child nodes of dbx5x0 devices */ if (of_machine_is_compatible ("st-ericsson,u8540" ))of_platform_populate (NULL , u8500_local_bus_nodes, - u8540_auxdata_lookup, parent); + u8540_auxdata_lookup,NULL );else of_platform_populate (NULL , u8500_local_bus_nodes, - u8500_auxdata_lookup, parent); + u8500_auxdata_lookup,NULL ); }static const char * stericsson_dt_platform_compat[] = {
arch/arm/mach-ux500/id.c deleted +0 -213
213 lines not on this page · raw message
arch/arm/mach-ux500/setup.h +0 -2
@@ -21,8 +21,6 @@ void ux500_restart(enum reboot_mode mode, const char *cmd);extern void __init ux500_init_irq (void ); -extern struct device *ux500_soc_device_init (void ); -extern void ux500_cpu_die (unsigned int cpu);#endif /* __ASM_ARCH_SETUP_H */
drivers/soc/Kconfig +1 -0
@@ -10,6 +10,7 @@ source "drivers/soc/samsung/Kconfig" source "drivers/soc/sunxi/Kconfig" source "drivers/soc/tegra/Kconfig" source "drivers/soc/ti/Kconfig" +source "drivers/soc/ux500/Kconfig" source "drivers/soc/versatile/Kconfig" endmenu
drivers/soc/Makefile +1 -0
@@ -15,4 +15,5 @@ obj-$(CONFIG_SOC_SAMSUNG) += samsung/ obj-$(CONFIG_ARCH_SUNXI) += sunxi/ obj-$(CONFIG_ARCH_TEGRA) += tegra/ obj-$(CONFIG_SOC_TI) += ti/ +obj-$(CONFIG_ARCH_U8500) += ux500/ obj-$(CONFIG_PLAT_VERSATILE) += versatile/
drivers/soc/ux500/Kconfig new file +7 -0
@@ -0,0 +1,7 @@ +config UX500_SOC_ID + bool "SoC bus for ST-Ericsson ux500" + depends on ARCH_U8500 || COMPILE_TEST + default ARCH_U8500 + help + Include support for the SoC bus on the ARM RealView platforms + providing some sysfs information about the ASIC variant.
drivers/soc/ux500/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-$(CONFIG_UX500_SOC_ID) += ux500-soc-id.o
drivers/soc/ux500/ux500-soc-id.c new file +222 -0
222 lines not on this page · raw message
Signature · 1 line
2.4.11
PATCH 11/11 ARM: ux500: consolidate base platform files
In reply to Linus WalleijFrom: Arnd Bergmann <[email protected]>
The cpu.c and cache-l2x0.c files hold only two or three simple functions each, and they are all called from the machine descriptors, so we can just move them all into the same file for simplicity and consistency.
--- arch/arm/mach-ux500/Makefile | 3 +- arch/arm/mach-ux500/cache-l2x0.c | 60 --------------------------- arch/arm/mach-ux500/cpu-db8500.c | 87 ++++++++++++++++++++++++++++++++++++++++ arch/arm/mach-ux500/cpu.c | 67 ------------------------------- arch/arm/mach-ux500/setup.h | 10 ----- 5 files changed, 88 insertions(+), 139 deletions(-) delete mode 100644 arch/arm/mach-ux500/cache-l2x0.c delete mode 100644 arch/arm/mach-ux500/cpu.c
arch/arm/mach-ux500/Makefile +1 -2
@@ -2,8 +2,7 @@ # Makefile for the linux kernel, U8500 machine. # -obj-y := cpu.o pm.o -obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o +obj-y := pm.o obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o obj-$(CONFIG_MACH_MOP500) += board-mop500-audio.o obj-$(CONFIG_SMP) += platsmp.o
arch/arm/mach-ux500/cache-l2x0.c deleted +0 -60
60 lines not on this page · raw message
arch/arm/mach-ux500/cpu-db8500.c +87 -0
109 lines not on this page · raw message
arch/arm/mach-ux500/cpu.c deleted +0 -67
67 lines not on this page · raw message
arch/arm/mach-ux500/setup.h +0 -10
@@ -11,16 +11,6 @@#ifndef __ASM_ARCH_SETUP_H#define __ASM_ARCH_SETUP_H -#include <asm/mach/arch.h> -#include <linux/init.h> - - -void ux500_l2x0_init (void ); - -void ux500_restart (enum reboot_mode mode,const char *cmd); - -extern void __init ux500_init_irq (void ); -extern void ux500_cpu_die (unsigned int cpu);#endif /* __ASM_ARCH_SETUP_H */
Signature · 1 line
2.4.11