[U-Boot] [PATCH 03/11] Blackfin: bf60x: add serial support

Sonic Zhang sonic.adi at gmail.com
Fri Feb 8 05:20:36 CET 2013


On Thu, Feb 7, 2013 at 6:15 PM, Wolfgang Denk <wd at denx.de> wrote:
> Dear Sonic Zhang,
>
> In message <1360223258-6945-4-git-send-email-sonic.adi at gmail.com> you wrote:
>>
>> Add serial for bf60x.
>
> There is a large number of checkpatch issues.  Please fix!!
>

OK.

>> +/*
>> + * All Blackfin system MMRs are padded to 32bits even if the register
>> + * itself is only 16bits.  So use a helper macro to streamline this.
>> + */
>> +#define __BFP(m) u16 m; u16 __pad_##m
>> +struct bfin_mmr_serial {
>> +#if BFIN_UART_HW_VER == 2
>> +     __BFP(dll);
>> +     __BFP(dlh);
>> +     __BFP(gctl);
>> +     __BFP(lcr);
>> +     __BFP(mcr);
>> +     __BFP(lsr);
>> +     __BFP(msr);
>> +     __BFP(scr);
>> +     __BFP(ier_set);
>> +     __BFP(ier_clear);
>> +     __BFP(thr);
>> +     __BFP(rbr);
>> +#else
>> +     union {
>> +             u16 dll;
>> +             u16 thr;
>> +             const u16 rbr;
>> +     };
>> +     const u16 __spad0;
>> +     union {
>> +             u16 dlh;
>> +             u16 ier;
>> +     };
>> +     const u16 __spad1;
>> +     const __BFP(iir);
>> +     __BFP(lcr);
>> +     __BFP(mcr);
>> +     __BFP(lsr);
>> +     __BFP(msr);
>> +     __BFP(scr);
>> +     const u32 __spad2;
>> +     __BFP(gctl);
>> +#endif
>
> Sorry, but this is totally unreadable.
>

I will turn back to normal definition other than the help Macro.

>
>> +# define DO_MUX(port, mux_tx, mux_rx, tx, rx) \
>> +     bfin_write_PORT##port##_MUX((bfin_read_PORT##port##_MUX() & ~(PORT_x_MUX_##mux_tx##_MASK | PORT_x_MUX_##mux_rx##_MASK)) | PORT_x_MUX_##mux_tx##_FUNC_1 | PORT_x_MUX_##mux_rx##_FUNC_1); \
>> +     bfin_write_PORT##port##_FER(bfin_read_PORT##port##_FER() | P##port##tx | P##port##rx);
>> +     switch (CONFIG_UART_CONSOLE) {
>> +     case 0:
>> +             DO_MUX(G, 7, 7, 12, 13);
>> +             break;  /* Port G; mux 7; PG12 and PG13 */
>> +     case 1:
>> +             DO_MUX(F, 3, 3, 6, 7);
>> +             break;  /* Port F; mux 3; PF6 and PF7 */
>
> This is totally unreadable.
>
> This needs serious fixing.

I will fix it.

Sonic


More information about the U-Boot mailing list