2014-06-28 20:34:35

by Aaro Koskinen

[permalink] [raw]
Subject: [PATCH 0/3] MIPS: OCTEON: Minimal support for D-Link DSR-1000N

Hi,

The following patches add minimal support for D-Link DSR-1000N router.
USB and ethernet ports should now work with these patches.
(I guess WLAN (PCI/ath9k) should work too; I was able to scan networks,
but for some reason it did not connect to my AP.)

Aaro Koskinen (3):
MIPS: OCTEON: cvmx-bootinfo: add D-Link DSR-1000N
MIPS: OCTEON: add USB clock type for D-Link DSR-1000N
MIPS: OCTEON: add interface & port definitions for D-Link DSR-1000N

.../cavium-octeon/executive/cvmx-helper-board.c | 22 ++++++++++++++++++++++
arch/mips/include/asm/octeon/cvmx-bootinfo.h | 2 ++
2 files changed, 24 insertions(+)

--
2.0.0


2014-06-28 20:34:36

by Aaro Koskinen

[permalink] [raw]
Subject: [PATCH 2/3] MIPS: OCTEON: add USB clock type for D-Link DSR-1000N

Add USB clock type for D-Link DSR-1000N.

Signed-off-by: Aaro Koskinen <[email protected]>
---
arch/mips/cavium-octeon/executive/cvmx-helper-board.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
index b764df6..6c871a5 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
@@ -738,6 +738,7 @@ enum cvmx_helper_board_usb_clock_types __cvmx_helper_board_usb_get_clock_type(vo
case CVMX_BOARD_TYPE_LANAI2_G:
case CVMX_BOARD_TYPE_NIC10E_66:
case CVMX_BOARD_TYPE_UBNT_E100:
+ case CVMX_BOARD_TYPE_CUST_DSR1000N:
return USB_CLOCK_TYPE_CRYSTAL_12;
case CVMX_BOARD_TYPE_NIC10E:
return USB_CLOCK_TYPE_REF_12;
--
2.0.0

2014-06-28 20:34:50

by Aaro Koskinen

[permalink] [raw]
Subject: [PATCH 3/3] MIPS: OCTEON: add interface & port definitions for D-Link DSR-1000N

Add interface & port definitions for D-Link DSR-1000N.

Signed-off-by: Aaro Koskinen <[email protected]>
---
.../cavium-octeon/executive/cvmx-helper-board.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)

diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
index 6c871a5..5dfef84 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
@@ -186,6 +186,15 @@ int cvmx_helper_board_get_mii_address(int ipd_port)
return 7 - ipd_port;
else
return -1;
+ case CVMX_BOARD_TYPE_CUST_DSR1000N:
+ /*
+ * Port 2 connects to Broadcom PHY (B5081). Other ports (0-1)
+ * connect to a switch (BCM53115).
+ */
+ if (ipd_port == 2)
+ return 8;
+ else
+ return -1;
}

/* Some unknown board. Somebody forgot to update this function... */
@@ -274,6 +283,18 @@ cvmx_helper_link_info_t __cvmx_helper_board_link_get(int ipd_port)
return result;
}
break;
+ case CVMX_BOARD_TYPE_CUST_DSR1000N:
+ if (ipd_port == 0 || ipd_port == 1) {
+ /* Ports 0 and 1 connect to a switch (BCM53115). */
+ result.s.link_up = 1;
+ result.s.full_duplex = 1;
+ result.s.speed = 1000;
+ return result;
+ } else {
+ /* Port 2 uses a Broadcom PHY (B5081). */
+ is_broadcom_phy = 1;
+ }
+ break;
}

phy_addr = cvmx_helper_board_get_mii_address(ipd_port);
--
2.0.0

2014-06-28 20:34:34

by Aaro Koskinen

[permalink] [raw]
Subject: [PATCH 1/3] MIPS: OCTEON: cvmx-bootinfo: add D-Link DSR-1000N

Add a definition for D-Link DSR-1000N router. The bootloader on this board
supplies 20006 in the bootinfo; the enum CVMX_BOARD_TYPE_CUST_DSR1000N
comes from the GPL sources of the board.

Signed-off-by: Aaro Koskinen <[email protected]>
---
arch/mips/include/asm/octeon/cvmx-bootinfo.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/mips/include/asm/octeon/cvmx-bootinfo.h b/arch/mips/include/asm/octeon/cvmx-bootinfo.h
index 7b7818d..2298199 100644
--- a/arch/mips/include/asm/octeon/cvmx-bootinfo.h
+++ b/arch/mips/include/asm/octeon/cvmx-bootinfo.h
@@ -228,6 +228,7 @@ enum cvmx_board_types_enum {
*/
CVMX_BOARD_TYPE_CUST_PRIVATE_MIN = 20001,
CVMX_BOARD_TYPE_UBNT_E100 = 20002,
+ CVMX_BOARD_TYPE_CUST_DSR1000N = 20006,
CVMX_BOARD_TYPE_CUST_PRIVATE_MAX = 30000,

/* The remaining range is reserved for future use. */
@@ -327,6 +328,7 @@ static inline const char *cvmx_board_type_to_string(enum
/* Customer private range */
ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MIN)
ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E100)
+ ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_DSR1000N)
ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MAX)
}
return "Unsupported Board";
--
2.0.0

2014-06-30 17:14:58

by David Daney

[permalink] [raw]
Subject: Re: [PATCH 0/3] MIPS: OCTEON: Minimal support for D-Link DSR-1000N

On 06/28/2014 01:34 PM, Aaro Koskinen wrote:
> Hi,
>
> The following patches add minimal support for D-Link DSR-1000N router.

Which OCTEON chip does this device contain?

Also what is the bootloader version on the board?

David Daney


> USB and ethernet ports should now work with these patches.
> (I guess WLAN (PCI/ath9k) should work too; I was able to scan networks,
> but for some reason it did not connect to my AP.)
>
> Aaro Koskinen (3):
> MIPS: OCTEON: cvmx-bootinfo: add D-Link DSR-1000N
> MIPS: OCTEON: add USB clock type for D-Link DSR-1000N
> MIPS: OCTEON: add interface & port definitions for D-Link DSR-1000N
>
> .../cavium-octeon/executive/cvmx-helper-board.c | 22 ++++++++++++++++++++++
> arch/mips/include/asm/octeon/cvmx-bootinfo.h | 2 ++
> 2 files changed, 24 insertions(+)
>

2014-06-30 19:17:52

by Aaro Koskinen

[permalink] [raw]
Subject: Re: [PATCH 0/3] MIPS: OCTEON: Minimal support for D-Link DSR-1000N

Hi,

On Mon, Jun 30, 2014 at 10:14:54AM -0700, David Daney wrote:
> On 06/28/2014 01:34 PM, Aaro Koskinen wrote:
> >The following patches add minimal support for D-Link DSR-1000N router.
>
> Which OCTEON chip does this device contain?

[ 0.000000] CPU0 revision is: 000d0601 (Cavium Octeon+)

# cat /proc/cpuinfo
system type : CUST_DSR1000N (CN5010p1.1-500-SCP)
machine : Unknown
processor : 0
cpu model : Cavium Octeon+ V0.1
BogoMIPS : 1000.00
wait instruction : yes
microsecond timers : yes
tlb_entries : 64
extra interrupt vector : yes
hardware watchpoint : yes, count: 2, address/irw mask: [0x0ffc, 0x0ffb]
isa : mips1 mips2 mips3 mips4 mips5 mips64r2
ASEs implemented :
shadow register sets : 1
kscratch registers : 0
core : 0
VCED exceptions : not available
VCEI exceptions : not available

> Also what is the bootloader version on the board?

D-Link DSR-1000N bootloader# version

U-Boot 1.1.1 (Development build, svnversion: exported) (Build time: Mar 22 2010
- 12:14:14)

BTW, .notes segment from kernel needs to be removed for this bootloader
with "strip -R .notes".

A.

2014-06-30 20:32:40

by David Daney

[permalink] [raw]
Subject: Re: [PATCH 0/3] MIPS: OCTEON: Minimal support for D-Link DSR-1000N

On 06/30/2014 12:17 PM, Aaro Koskinen wrote:
> Hi,
>
> On Mon, Jun 30, 2014 at 10:14:54AM -0700, David Daney wrote:
>> On 06/28/2014 01:34 PM, Aaro Koskinen wrote:
>>> The following patches add minimal support for D-Link DSR-1000N router.
>>
>> Which OCTEON chip does this device contain?
>
> [ 0.000000] CPU0 revision is: 000d0601 (Cavium Octeon+)
>
> # cat /proc/cpuinfo
> system type : CUST_DSR1000N (CN5010p1.1-500-SCP)
> machine : Unknown
> processor : 0
> cpu model : Cavium Octeon+ V0.1
> BogoMIPS : 1000.00
> wait instruction : yes
> microsecond timers : yes
> tlb_entries : 64
> extra interrupt vector : yes
> hardware watchpoint : yes, count: 2, address/irw mask: [0x0ffc, 0x0ffb]
> isa : mips1 mips2 mips3 mips4 mips5 mips64r2
> ASEs implemented :
> shadow register sets : 1
> kscratch registers : 0
> core : 0
> VCED exceptions : not available
> VCEI exceptions : not available
>
>> Also what is the bootloader version on the board?
>
> D-Link DSR-1000N bootloader# version
>
> U-Boot 1.1.1 (Development build, svnversion: exported) (Build time: Mar 22 2010
> - 12:14:14)
>
> BTW, .notes segment from kernel needs to be removed for this bootloader
> with "strip -R .notes".
>

Too bad it doesn't have a modern bootloader that passes a device tree.

The whole series: Acked-by: David Daney <[email protected]>