[PATCH v2 04/10] arm: zynq: Load scu baseaddress at run time

Michal Simek monstr at monstr.eu
Wed Mar 27 05:37:58 EDT 2013


2013/3/27 Arnd Bergmann <arnd at arndb.de>:
> On Wednesday 27 March 2013, Michal Simek wrote:
>> 2013/3/26 Arnd Bergmann <arnd at arndb.de>:
>> > On Tuesday 26 March 2013, Michal Simek wrote:
>> >> +void __iomem *scu_base;
>> >> +
>> >
>> > This cannot be a global variable in a multiplatform kernel. Can you
>> > make it static?
>>
>> This global variable is shared because I am using it in smp code
>> and also it will be used in pm code we have.
>>
>> What is it another way how to handle this?
>>
>> Because the same problem could be with zynq_slcr_base.
>>
>> Or the rule is just to use zynq_ prefix for all global variables?
>>
>
> Yes. The best solution is to mke variables local to some context and
> only pointed to by other data structures. If that doesn't work, you
> should try using a static variable in one file and move all code using
> it there. If that doesn't work, you need a global variable, but that
> must be uniquely named.

FYI: I have looked at some code and I saw that Rob is using scu_base_addr
in highbank. And then pointing to it in cpuidle-calxeda.c.

Moving everything to one file is probably impossible.

And in connection to symbols/functions/variables. It means that all
specific soc functions in mach
should also use specific prefix for everything.

Thanks,
Michal


-- 
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform



More information about the linux-arm-kernel mailing list