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

Jonas Gorski jogo at openwrt.org
Fri Jun 27 07:14:53 EDT 2014


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.

> COMPILE_TEST is added if the patch has interest for linux-mips. You
> are right: in OpenWRT is useless.
> Any advice to improve it?

It's actually the hw random (crypto?) guys that would be interested in
this, mips is only collateral because some of the headers exist in
arch/mips.

To satisfy COMPILE_TEST, convert any bcm_{read,write}* calls to
__raw_{read,write}*, probably
move the register definitions from include/asm/mach-bcm63xx/* to the
driver itself. If you can enable it for x86 and it compiles, then you
succeeded ;-)


Jonas
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list