Re: [RFC, PATCH v2 1/3] MIPS: add Atheros ar531x family support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Oleksij,

On Wed, May 22, 2013 at 09:49:47AM +0200, Oleksij Rempel wrote:
> Signed-off-by: Oleksij Rempel <linux@xxxxxxxxxxxxxxxx>
> Signed-off-by: Antony Pavlov <antonynpavlov@xxxxxxxxx>
> +
> +/*
> + * This table is indexed by bits 5..4 of the CLOCKCTL1 register
> + * to determine the predevisor value.
> + */
> +static int CLOCKCTL1_PREDIVIDE_TABLE[4] = { 1, 2, 4, 5 };
> +
> +static unsigned int
> +ar2312_cpu_frequency(void)
> +{
> +	unsigned int predivide_mask, predivide_shift;
> +	unsigned int multiplier_mask, multiplier_shift;
> +	unsigned int clockCtl1, preDivideSelect, preDivisor, multiplier;

No CamelCase please.

> +static int platform_init(void)
> +{
> +	add_generic_device("ar2312_reset", DEVICE_ID_SINGLE, NULL,
> +			KSEG1ADDR(AR2312_RESETTMR), 0x4,
> +			IORESOURCE_MEM, NULL);
> +	watchdog_init();
> +	flash_init();
> +	ether_init();

Whether or not the flash/ethernet/serial device is available is board
specific, not SoC specific, so this should be done in board code. It's
good to provide helpers to make this simple for the board code though,
so a good option would be to add a SoC prefix to the functions and call
it from board code.

Otherwise I am fine with this patch, but maybe Antony still has some
comments.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux