[PATCH 3/6] bus: mvebu: add mbus driver

Sascha Hauer s.hauer at pengutronix.de
Fri Feb 7 01:58:12 EST 2014


Hi Sebastian,

On Wed, Feb 05, 2014 at 11:40:06PM +0100, Sebastian Hesselbarth wrote:
> + *   device accesses. This API is mvebu_mbus_add_window_by_id(),
> + *   mvebu_mbus_add_window_remap_by_id() and
> + *   mvebu_mbus_del_window().
> + *
> + * - Provides a debugfs interface in /sys/kernel/debug/mvebu-mbus/ to
> + *   see the list of CPU -> SDRAM windows and their configuration
> + *   (file 'sdram') and the list of CPU -> devices windows and their
> + *   configuration (file 'devices').
> + */

I'm inclined to say that you should use dev_* functions for debugging,
but I see the code is very close to the kernel and you don't have a
struct device_d pointer everywhere. Up to you to use dev_*, but if not
please add a #define pr_fmt here.

> +
> +#include <common.h>
> +#include <init.h>
> +#include <io.h>
> +#include <of.h>
> +#include <of_address.h>
> +#include <linux/mbus.h>
> +

[...]

> +
> +static const struct mvebu_mbus_soc_data orion5x_2win_mbus_data = {
> +	.num_wins            = 8,
> +	.num_remappable_wins = 2,
> +	.win_cfg_offset      = orion5x_mbus_win_offset,
> +	.setup_cpu_target    = mvebu_mbus_default_setup_cpu_target,
> +};
> +
> +static const struct mvebu_mbus_soc_data mv78xx0_mbus_data = {
> +	.num_wins            = 14,
> +	.num_remappable_wins = 8,
> +	.win_cfg_offset      = mv78xx0_mbus_win_offset,
> +	.setup_cpu_target    = mvebu_mbus_default_setup_cpu_target,
> +};

Don't you end up with unused variable warnings here if not all SoCs are
enabled? Maybe add some __maybe_unused here.

> +
> +static struct of_device_id mvebu_mbus_dt_ids[] = {
> +#if defined(CONFIG_ARCH_ARMADA_370) || defined(CONFIG_ARCH_ARMADA_XP)
> +	{ .compatible = "marvell,armada370-mbus",
> +	  .data = (u32)&armada_370_xp_mbus_data, },
> +	{ .compatible = "marvell,armadaxp-mbus",
> +	  .data = (u32)&armada_370_xp_mbus_data, },
> +#endif
> +#if defined(CONFIG_ARCH_DOVE)
> +	{ .compatible = "marvell,dove-mbus",
> +	  .data = (u32)&dove_mbus_data, },
> +#endif

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 |



More information about the barebox mailing list