diff mbox series

[U-Boot,1/1] configs: sunxi: enable BLK, DM_MMC, DM_SCSI

Message ID 20180318152006.5303-1-xypron.glpk@gmx.de
State Changes Requested
Delegated to: Jagannadha Sutradharudu Teki
Headers show
Series [U-Boot,1/1] configs: sunxi: enable BLK, DM_MMC, DM_SCSI | expand

Commit Message

Heinrich Schuchardt March 18, 2018, 3:20 p.m. UTC
doc/driver-model/MIGRATION.txt requires to move block drivers to the
the driver model by v2018.05

So make the switch for the SUNXI block drivers.

Select BLK, DM_MMC, and DM_SCSI.

DM_USB dpends on USB but there is no necessity to make it depend on
DISTRO_DEFAULTS.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 arch/arm/Kconfig | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Maxime Ripard March 18, 2018, 9:21 p.m. UTC | #1
Hi,

On Sun, Mar 18, 2018 at 04:20:06PM +0100, Heinrich Schuchardt wrote:
> doc/driver-model/MIGRATION.txt requires to move block drivers to the
> the driver model by v2018.05
> 
> So make the switch for the SUNXI block drivers.
> 
> Select BLK, DM_MMC, and DM_SCSI.
> 
> DM_USB dpends on USB but there is no necessity to make it depend on
> DISTRO_DEFAULTS.

That should be a separate patch.

> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  arch/arm/Kconfig | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 2c52ff025a..b608f01beb 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -715,13 +715,16 @@ config ARCH_SUNXI
>  	select BINMAN
>  	select CMD_GPIO
>  	select CMD_MMC if MMC
> -	select CMD_USB if DISTRO_DEFAULTS
> +	select CMD_USB if USB
>  	select DM
> +	select BLK

You assume here that you always have a block device, which might not
be the case (for example if you only have a NAND chip on your board).

>  	select DM_ETH
>  	select DM_GPIO
>  	select DM_KEYBOARD
> +	select DM_MMC

Ditto.

> +	select DM_SCSI


Ditto, with SATA.

Thanks!
Maxime
Heinrich Schuchardt March 18, 2018, 9:49 p.m. UTC | #2
On 03/18/2018 10:21 PM, Maxime Ripard wrote:
> Hi,
> 
> On Sun, Mar 18, 2018 at 04:20:06PM +0100, Heinrich Schuchardt wrote:
>> doc/driver-model/MIGRATION.txt requires to move block drivers to the
>> the driver model by v2018.05
>>
>> So make the switch for the SUNXI block drivers.
>>
>> Select BLK, DM_MMC, and DM_SCSI.
>>
>> DM_USB dpends on USB but there is no necessity to make it depend on
>> DISTRO_DEFAULTS.
> 
> That should be a separate patch.
> 
>> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>> ---
>>  arch/arm/Kconfig | 7 +++++--
>>  1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>> index 2c52ff025a..b608f01beb 100644
>> --- a/arch/arm/Kconfig
>> +++ b/arch/arm/Kconfig
>> @@ -715,13 +715,16 @@ config ARCH_SUNXI
>>  	select BINMAN
>>  	select CMD_GPIO
>>  	select CMD_MMC if MMC
>> -	select CMD_USB if DISTRO_DEFAULTS
>> +	select CMD_USB if USB
>>  	select DM
>> +	select BLK
> 
> You assume here that you always have a block device, which might not
> be the case (for example if you only have a NAND chip on your board).
I ran a full Travis test for Sunxi boards and could not see any compile
error only a time out for one group of boards.

BLK is used by #ifdefs in code handling block devices. It has no effect
if the block device code is not built.

> 
>>  	select DM_ETH

Here you already select DM_ETH without requiring network. It simply has
not effect if there is not network driver built.

>>  	select DM_GPIO
>>  	select DM_KEYBOARD
>> +	select DM_MMC
> 
> Ditto.

DM_MMC only depends on DM not on MMC see drivers/mmc/Kconfig
If you don't build MMC code it has no effect.

> 
>> +	select DM_SCSI
> 
> 
> Ditto, with SATA.

If you don't build SCSI or ATA code the flag has no effect.

Regards

Heinrich
Maxime Ripard March 20, 2018, 2:29 p.m. UTC | #3
On Sun, Mar 18, 2018 at 10:49:57PM +0100, Heinrich Schuchardt wrote:
> On 03/18/2018 10:21 PM, Maxime Ripard wrote:
> > Hi,
> > 
> > On Sun, Mar 18, 2018 at 04:20:06PM +0100, Heinrich Schuchardt wrote:
> >> doc/driver-model/MIGRATION.txt requires to move block drivers to the
> >> the driver model by v2018.05
> >>
> >> So make the switch for the SUNXI block drivers.
> >>
> >> Select BLK, DM_MMC, and DM_SCSI.
> >>
> >> DM_USB dpends on USB but there is no necessity to make it depend on
> >> DISTRO_DEFAULTS.
> > 
> > That should be a separate patch.
> > 
> >> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> >> ---
> >>  arch/arm/Kconfig | 7 +++++--
> >>  1 file changed, 5 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> >> index 2c52ff025a..b608f01beb 100644
> >> --- a/arch/arm/Kconfig
> >> +++ b/arch/arm/Kconfig
> >> @@ -715,13 +715,16 @@ config ARCH_SUNXI
> >>  	select BINMAN
> >>  	select CMD_GPIO
> >>  	select CMD_MMC if MMC
> >> -	select CMD_USB if DISTRO_DEFAULTS
> >> +	select CMD_USB if USB
> >>  	select DM
> >> +	select BLK
> > 
> > You assume here that you always have a block device, which might not
> > be the case (for example if you only have a NAND chip on your board).
> I ran a full Travis test for Sunxi boards and could not see any compile
> error only a time out for one group of boards.
> 
> BLK is used by #ifdefs in code handling block devices. It has no effect
> if the block device code is not built.

Still, you add some completely unnecessary code in such a case.

> > 
> >>  	select DM_ETH
> 
> Here you already select DM_ETH without requiring network. It simply has
> not effect if there is not network driver built.

You're right, it should probably be fixed as well.

> >>  	select DM_GPIO
> >>  	select DM_KEYBOARD
> >> +	select DM_MMC
> > 
> > Ditto.
> 
> DM_MMC only depends on DM not on MMC see drivers/mmc/Kconfig
> If you don't build MMC code it has no effect.

But then, you have some dead code.

> >> +	select DM_SCSI
> > 
> > 
> > Ditto, with SATA.
> 
> If you don't build SCSI or ATA code the flag has no effect.

And same argument here.

Maxime
Heinrich Schuchardt March 24, 2018, 10:35 a.m. UTC | #4
On 03/20/2018 03:29 PM, Maxime Ripard wrote:
> On Sun, Mar 18, 2018 at 10:49:57PM +0100, Heinrich Schuchardt wrote:
>> On 03/18/2018 10:21 PM, Maxime Ripard wrote:
>>> Hi,
>>>
>>> On Sun, Mar 18, 2018 at 04:20:06PM +0100, Heinrich Schuchardt wrote:
>>>> doc/driver-model/MIGRATION.txt requires to move block drivers to the
>>>> the driver model by v2018.05
>>>>
>>>> So make the switch for the SUNXI block drivers.
>>>>
>>>> Select BLK, DM_MMC, and DM_SCSI.
>>>>
>>>> DM_USB dpends on USB but there is no necessity to make it depend on
>>>> DISTRO_DEFAULTS.
>>>
>>> That should be a separate patch.
>>>
>>>> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>>>> ---
>>>>  arch/arm/Kconfig | 7 +++++--
>>>>  1 file changed, 5 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>>>> index 2c52ff025a..b608f01beb 100644
>>>> --- a/arch/arm/Kconfig
>>>> +++ b/arch/arm/Kconfig
>>>> @@ -715,13 +715,16 @@ config ARCH_SUNXI
>>>>  	select BINMAN
>>>>  	select CMD_GPIO
>>>>  	select CMD_MMC if MMC
>>>> -	select CMD_USB if DISTRO_DEFAULTS
>>>> +	select CMD_USB if USB
>>>>  	select DM
>>>> +	select BLK
>>>
>>> You assume here that you always have a block device, which might not
>>> be the case (for example if you only have a NAND chip on your board).
>> I ran a full Travis test for Sunxi boards and could not see any compile
>> error only a time out for one group of boards.
>>
>> BLK is used by #ifdefs in code handling block devices. It has no effect
>> if the block device code is not built.
> 
> Still, you add some completely unnecessary code in such a case.

Even if there is no block device I still want to be able to start iPXE
via bootefi and to attach an iSCSI drive. This requires BLK.

> 
>>>
>>>>  	select DM_ETH
>>
>> Here you already select DM_ETH without requiring network. It simply has
>> not effect if there is not network driver built.
> 
> You're right, it should probably be fixed as well.
> 
>>>>  	select DM_GPIO
>>>>  	select DM_KEYBOARD
>>>> +	select DM_MMC
>>>
>>> Ditto.
>>
>> DM_MMC only depends on DM not on MMC see drivers/mmc/Kconfig
>> If you don't build MMC code it has no effect.
> 
> But then, you have some dead code.

I could not find any. Please, indicate where.

Best regards

Heinrich

> 
>>>> +	select DM_SCSI
>>>
>>>
>>> Ditto, with SATA.
>>
>> If you don't build SCSI or ATA code the flag has no effect.
> 
> And same argument here.
> 
> Maxime
>
diff mbox series

Patch

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 2c52ff025a..b608f01beb 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -715,13 +715,16 @@  config ARCH_SUNXI
 	select BINMAN
 	select CMD_GPIO
 	select CMD_MMC if MMC
-	select CMD_USB if DISTRO_DEFAULTS
+	select CMD_USB if USB
 	select DM
+	select BLK
 	select DM_ETH
 	select DM_GPIO
 	select DM_KEYBOARD
+	select DM_MMC
+	select DM_SCSI
 	select DM_SERIAL
-	select DM_USB if DISTRO_DEFAULTS
+	select DM_USB if USB
 	select OF_BOARD_SETUP
 	select OF_CONTROL
 	select OF_SEPARATE