Platform setup via DTS
Joel Stanley
joel at jms.id.au
Wed Aug 17 10:59:30 AEST 2016
Hey Anton,
On Thu, Aug 11, 2016 at 9:27 PM, Anton D. Kachalov <mouse at yandex-team.ru> wrote:
> I would like to start a little discussion around board setup process in arch/arm/mach-aspeed/aspeed.c.
> For most cases this process is "flat": just modifying regs one-by-one. Sometimes with applying mask.
> I have an idea to add an array of "instructions" to the Device Tree in the following manner
> (I hope dtc's preprocess via cpp resolve ORed macro in the correct way):
I agree that we need to remove the board file.
However, we will not be able to get changes upstream that use the
device tree as a scripting language :)
I think the solution is to write a driver for the different parts of
the system we require. Andrew J has done that for the multi-function
pin control registers in the SCU. I've got a work in progress driver
for the clock related registers. Next up would be a driver for the LPC
register space to properly configure that.
Cheers,
Joel
>
> ==========
> #include <dt-bindings/soc/aspeed.h>
>
> / {
> model = "Our HW";
> compatible = "aspeed,ast2400";
> board-setup = <WR, AST_BASE_LPC | 0x9c, 0x02010023, 0>,
> <WR, AST_BASE_SCU, SCU_PASSWORD, 0>,
> <WR, AST_BASE_SCU | 0x80, 0xcb000000, 0>,
> ...
> /* write(read() | 0x1000) */
> <OR, AST_BASE_SCU | 0x2c, 0x00001000, 0>,
>
> /* write((read() &~ 0x2000) | 0x1000) */
> <OR, AST_BASE_SCU | 0x2c, 0x00001000, 0x2000>;
> ==========
>
> or in less talkative way:
>
> ==========
> /* write((read() &~ 0) | 0xcb000000) */
> <AST_BASE_SCU | 0x80, 0xcb000000, 0>,
> ...
> /* write((read() &~ 0x1000) | 0x1000) */
> <AST_BASE_SCU | 0x2c, 0x00001000, 0x1000>,
> ==========
>
> to completely eliminate board-specific init functions.
>
>
> --
> Anton D. Kachalov
> _______________________________________________
> openbmc mailing list
> openbmc at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/openbmc
More information about the openbmc
mailing list