Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e1ac4b40 authored by Rafał Miłecki's avatar Rafał Miłecki Committed by John W. Linville
Browse files

bcma: add trivial GBIT MAC COMMON driver



GMAC COMMON core is present on BCM4706 and is used for example to access
board PHYs (PHYs can not be accessed directly using GBIT MAC core).

Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
Acked-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 97cfda8f
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -46,6 +46,15 @@ config BCMA_DRIVER_MIPS

	  If unsure, say N

config BCMA_DRIVER_GMAC_CMN
	bool "BCMA Broadcom GBIT MAC COMMON core driver"
	depends on BCMA
	help
	  Driver for the Broadcom GBIT MAC COMMON core attached to Broadcom
	  specific Advanced Microcontroller Bus.

	  If unsure, say N

config BCMA_DEBUG
	bool "BCMA debugging"
	depends on BCMA
+1 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ bcma-y += driver_chipcommon.o driver_chipcommon_pmu.o
bcma-y					+= driver_pci.o
bcma-$(CONFIG_BCMA_DRIVER_PCI_HOSTMODE)	+= driver_pci_host.o
bcma-$(CONFIG_BCMA_DRIVER_MIPS)		+= driver_mips.o
bcma-$(CONFIG_BCMA_DRIVER_GMAC_CMN)	+= driver_gmac_cmn.o
bcma-$(CONFIG_BCMA_HOST_PCI)		+= host_pci.o
bcma-$(CONFIG_BCMA_HOST_SOC)		+= host_soc.o
obj-$(CONFIG_BCMA)			+= bcma.o
+14 −0
Original line number Diff line number Diff line
/*
 * Broadcom specific AMBA
 * GBIT MAC COMMON Core
 *
 * Licensed under the GNU/GPL. See COPYING for details.
 */

#include "bcma_private.h"
#include <linux/bcma/bcma.h>

void __devinit bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc)
{
	mutex_init(&gc->phy_mutex);
}
+8 −0
Original line number Diff line number Diff line
@@ -103,6 +103,7 @@ static int bcma_register_cores(struct bcma_bus *bus)
		case BCMA_CORE_PCI:
		case BCMA_CORE_PCIE:
		case BCMA_CORE_MIPS_74K:
		case BCMA_CORE_4706_MAC_GBIT_COMMON:
			continue;
		}

@@ -185,6 +186,13 @@ int __devinit bcma_bus_register(struct bcma_bus *bus)
		bcma_core_pci_init(&bus->drv_pci);
	}

	/* Init GBIT MAC COMMON core */
	core = bcma_find_core(bus, BCMA_CORE_4706_MAC_GBIT_COMMON);
	if (core) {
		bus->drv_gmac_cmn.core = core;
		bcma_core_gmac_cmn_init(&bus->drv_gmac_cmn);
	}

	/* Try to get SPROM */
	err = bcma_sprom_get(bus);
	if (err == -ENOENT) {
+10 −6
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ struct bcma_device_id_name {
};

static const struct bcma_device_id_name bcma_arm_device_names[] = {
	{ BCMA_CORE_4706_MAC_GBIT_COMMON, "BCM4706 GBit MAC Common" },
	{ BCMA_CORE_ARM_1176, "ARM 1176" },
	{ BCMA_CORE_ARM_7TDMI, "ARM 7TDMI" },
	{ BCMA_CORE_ARM_CM3, "ARM CM3" },
@@ -33,7 +34,6 @@ static const struct bcma_device_id_name bcma_bcm_device_names[] = {
	{ BCMA_CORE_4706_MAC_GBIT, "BCM4706 GBit MAC" },
	{ BCMA_CORE_AMEMC, "AMEMC (DDR)" },
	{ BCMA_CORE_ALTA, "ALTA (I2S)" },
	{ BCMA_CORE_4706_MAC_GBIT_COMMON, "BCM4706 GBit MAC Common" },
	{ BCMA_CORE_INVALID, "Invalid" },
	{ BCMA_CORE_CHIPCOMMON, "ChipCommon" },
	{ BCMA_CORE_ILINE20, "ILine 20" },
@@ -295,12 +295,16 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr,

	/* check if component is a core at all */
	if (wrappers[0] + wrappers[1] == 0) {
		/* we could save addrl of the router
		if (cid == BCMA_CORE_OOB_ROUTER)
		 */
		/* Some specific cores don't need wrappers */
		switch (core->id.id) {
		case BCMA_CORE_4706_MAC_GBIT_COMMON:
		/* Not used yet: case BCMA_CORE_OOB_ROUTER: */
			break;
		default:
			bcma_erom_skip_component(bus, eromptr);
			return -ENXIO;
		}
	}

	if (bcma_erom_is_bridge(bus, eromptr)) {
		bcma_erom_skip_component(bus, eromptr);
Loading