Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
lede-mikrotik
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Johannes Rudolph
lede-mikrotik
Commits
3515a89f
Commit
3515a89f
authored
14 years ago
by
Florian Fainelli
Browse files
Options
Downloads
Patches
Plain Diff
make adm6996 switches work on tnetd7200 and tnetd7300
SVN-Revision: 22771
parent
bb28b994
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
target/linux/ar7/config-2.6.32
+1
-0
1 addition, 0 deletions
target/linux/ar7/config-2.6.32
target/linux/ar7/patches-2.6.32/972-cpmac_multi_probe.patch
+67
-0
67 additions, 0 deletions
target/linux/ar7/patches-2.6.32/972-cpmac_multi_probe.patch
with
68 additions
and
0 deletions
target/linux/ar7/config-2.6.32
+
1
−
0
View file @
3515a89f
...
@@ -60,6 +60,7 @@ CONFIG_DECOMPRESS_LZMA=y
...
@@ -60,6 +60,7 @@ CONFIG_DECOMPRESS_LZMA=y
CONFIG_DMA_NEED_PCI_MAP_STATE=y
CONFIG_DMA_NEED_PCI_MAP_STATE=y
CONFIG_DMA_NONCOHERENT=y
CONFIG_DMA_NONCOHERENT=y
CONFIG_EARLY_PRINTK=y
CONFIG_EARLY_PRINTK=y
CONFIG_FIXED_PHY=y
# CONFIG_FSNOTIFY is not set
# CONFIG_FSNOTIFY is not set
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
...
...
This diff is collapsed.
Click to expand it.
target/linux/ar7/patches-2.6.32/972-cpmac_multi_probe.patch
0 → 100644
+
67
−
0
View file @
3515a89f
--- a/drivers/net/cpmac.c
+++ b/drivers/net/cpmac.c
@@ -33,6 +33,7 @@
#include <linux/skbuff.h>
#include <linux/mii.h>
#include <linux/phy.h>
+#include <linux/phy_fixed.h>
#include <linux/platform_device.h>
#include <linux/dma-mapping.h>
#include <asm/gpio.h>
@@ -217,6 +218,12 @@
static void cpmac_hw_stop(struct net_dev
static int cpmac_stop(struct net_device *dev);
static int cpmac_open(struct net_device *dev);
+static struct fixed_phy_status fixed_phy_status = {
+ .link = 1,
+ .speed = 100,
+ .duplex = 1,
+};
+
static void cpmac_dump_regs(struct net_device *dev)
{
int i;
@@ -1122,12 +1129,39 @@
static int __devinit cpmac_probe(struct
strncpy(mdio_bus_id, cpmac_mii->id, MII_BUS_ID_SIZE);
break;
}
-
- if (phy_id == PHY_MAX_ADDR) {
- dev_err(&pdev->dev, "no PHY present\n");
- return -ENODEV;
+
+ if (phy_id < PHY_MAX_ADDR)
+ goto dev_alloc;
+
+ dev_info(&pdev->dev, "trying external MII\n");
+ /* Now disable EPHY and enable MII */
+ ar7_device_disable(AR7_RESET_BIT_EPHY);
+ *(unsigned long*) ioremap(0x08611A08, 4) |= 0x00000001;
+
+ for (phy_id = 0; phy_id < PHY_MAX_ADDR; phy_id++) {
+ if (!(pdata->phy_mask & (1 << phy_id)))
+ continue;
+ if (!cpmac_mii->phy_map[phy_id])
+ continue;
+ strncpy(mdio_bus_id, cpmac_mii->id, MII_BUS_ID_SIZE);
+ break;
+ }
+
+ if (phy_id < PHY_MAX_ADDR)
+ goto dev_alloc;
+
+ /* This still does not work, so now we register a fixed phy */
+ dev_info(&pdev->dev, "using fixed PHY\n");
+ rc = fixed_phy_add(PHY_POLL, pdev->id, &fixed_phy_status);
+ if (rc && rc != -ENODEV) {
+ dev_err(&pdev->dev, "unable to register fixed PHY\n");
+ return rc;
}
+ strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); /* fixed phys bus */
+ phy_id = pdev->id;
+
+dev_alloc:
dev = alloc_etherdev_mq(sizeof(*priv), CPMAC_QUEUES);
if (!dev) {
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment