[OpenWrt-Devel] [Patch][BCM63XX][V2][RFC] Select HW_RANDOM_BCM63XX only in the SoCs that support it.

Jonas Gorski jogo at openwrt.org
Sat Jun 28 12:10:10 EDT 2014

On Sat, Jun 28, 2014 at 3:09 PM, José Vázquez <ppvazquezfer at gmail.com> wrote:
> 2014-06-27 13:14 GMT+02:00, Jonas Gorski <jogo at openwrt.org>:
>> On Fri, Jun 27, 2014 at 1:00 PM, José Vázquez <ppvazquezfer at gmail.com>
>> wrote:
>>> 2014-06-27 12:29 GMT+02:00, Jonas Gorski <jogo at openwrt.org>:
>>>> On Wed, Jun 18, 2014 at 5:34 PM, José Vázquez Fernández
>>>> <ppvazquezfer at gmail.com> wrote:
>>>>> Select HW_RANDOM_BCM63XX only in the SoCs that support it.
>>>>> Only BCM6368, BCM6362 and BCM63268 have a hardware random numbers
>>>>> generator, so, if none of these are selected, don't compile it.
>>>>> Tested with BCM6358 and BCM6328 successfully with both 3.10 and 3.14
>>>>> kernels.
>>>>> Signed off by: José Vázquez Fernández <ppvazquezfer at gmail.com>
>>>> Sorry, I still don't see the point of this. All this patch does is
>>>> slightly reduce the visibility of HW_RANDOM_BCM63XX. And since this is
>>>> a user selectable symbol, I don't think this makes much sense because
>>>> if you don't want it built, you can just not select it.
>>>> Also, COMPILE_TEST should only be added if it actually compiles for
>>>> other arches (or even different mips targets), which it doesn't.
>>>> Jonas
>>> The point is that, if HW_RANDOM_BCM63XX is deselected, the kernel
>>> sends an error because HW_RANDOM_BCM63XX depends on BCM63XX. The
>>> patch, as you saw, force compilation of trng only in the SoCs that has
>>> that hardware. If in the kernel are only selected SoCs that don't have
>>> that hardware, the driver is not compiled.
>> "sends an error"? Can please paste the actual error message? Because I
>> don't see one if I disable HW_RANDOM_BCM63XX.
> This is the error message:
> TTY driver to output user messages via printk (TTY_PRINTK) [N/y/?] n
> Hardware Random Number Generator Core support (HW_RANDOM) [Y/n/m/?] y
>   Timer IOMEM HW Random Number Generator support
>   Atmel Random Number Generator support (HW_RANDOM_ATMEL) [N/m/y/?] n
>   Broadcom BCM63xx Random Number Generator support (HW_RANDOM_BCM63XX)
> [Y/n/m/?] (NEW) aborted!
> Console input/output is redirected. Run 'make oldconfig' to update
> configuration.
> make[7]: *** [silentoldconfig] Error 1
> make[6]: *** [silentoldconfig] Error 2
> The present kernel configuration has modules disabled.
> Type 'make config' and enable loadable module support.
> Then build a kernel with module support enabled.
> make[5]: *** [modules] Error 1
> make[5]: Leaving directory
> `/home/taxodium/trunk/build_dir/target-mips_mips32_uClibc-'

This means your kernel configuration is missing "# HW_RANDOM_BCM63XX
is not set" in target/linux/brcm63xx/config-3.10, which is *not* an
issue of the Kernel, but only of your incomplete, custom kernel
configuration. This would have happened with any missing kernel config
symbol, and is nothing specific of HW_RANDOM_BCM63XX.

I guess you just deleted the line from the config-3.10. But the kernel
config does not work this way - you need to use make kernel_menuconfig
to change the kernel config symbols, or ensure that you only replace
values (e.g. "CONFIG_foo=y" <=> "# CONFIG_foo is not set" - the
important part is that a line containing CONFIG_foo still exists).

> (snip)
> I'll send COMPILE_TEST patch with the modifications that you recommend
> to linux-mips because Florian sent the driver to that patchwork two
> years ago and it was accepted.

Use scripts/get_maintainer.pl to get the correct people/mailing lists
to send the patch to. Also use a current kernel tree of course, not

openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list