All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once
@ 2013-05-26 20:35 Aaro Koskinen
  2013-05-26 20:35 ` [PATCH 2/2] MIPS: cavium-octeon: enable interfaces on EdgeRouter Lite Aaro Koskinen
  2013-05-27 10:19 ` [PATCH 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once Sergei Shtylyov
  0 siblings, 2 replies; 4+ messages in thread
From: Aaro Koskinen @ 2013-05-26 20:35 UTC (permalink / raw)
  To: Ralf Baechle, linux-mips, linux-kernel; +Cc: Aaro Koskinen

When booting a new board for the first time, the console is flooded with
"Unknown board" messages. This is not really helpful. Board type is not
going to change after the boot, so it's sufficient to print the warning
only once.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
 arch/mips/cavium-octeon/executive/cvmx-helper-board.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
index 7c64977..e0451a0 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
@@ -31,6 +31,8 @@
  * network ports from the rest of the cvmx-helper files.
  */
 
+#include <linux/printk.h>
+
 #include <asm/octeon/octeon.h>
 #include <asm/octeon/cvmx-bootinfo.h>
 
@@ -184,8 +186,7 @@ int cvmx_helper_board_get_mii_address(int ipd_port)
 	}
 
 	/* Some unknown board. Somebody forgot to update this function... */
-	cvmx_dprintf
-	    ("cvmx_helper_board_get_mii_address: Unknown board type %d\n",
+	pr_warn_once("%s: Unknown board type %d\n", __func__,
 	     cvmx_sysinfo_get()->board_type);
 	return -1;
 }
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] MIPS: cavium-octeon: enable interfaces on EdgeRouter Lite
  2013-05-26 20:35 [PATCH 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once Aaro Koskinen
@ 2013-05-26 20:35 ` Aaro Koskinen
  2013-05-27 10:19 ` [PATCH 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once Sergei Shtylyov
  1 sibling, 0 replies; 4+ messages in thread
From: Aaro Koskinen @ 2013-05-26 20:35 UTC (permalink / raw)
  To: Ralf Baechle, linux-mips, linux-kernel; +Cc: Aaro Koskinen

Enable interfaces on EdgeRouter Lite. Tested with cavium_octeon_defconfig
and busybox shell. DHCP & ping works with eth0, eth1 and eth2.

The board type "UBNT_E100" is taken from the sources of the vendor kernel
shipped with the product.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
 arch/mips/cavium-octeon/executive/cvmx-helper-board.c |   13 +++++++++++++
 arch/mips/include/asm/octeon/cvmx-bootinfo.h          |    2 ++
 2 files changed, 15 insertions(+)

diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
index e0451a0..f489667 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
@@ -183,6 +183,11 @@ int cvmx_helper_board_get_mii_address(int ipd_port)
 			return ipd_port - 16 + 4;
 		else
 			return -1;
+	case CVMX_BOARD_TYPE_UBNT_E100:
+		if (ipd_port >= 0 && ipd_port <= 2)
+			return 7 - ipd_port;
+		else
+			return -1;
 	}
 
 	/* Some unknown board. Somebody forgot to update this function... */
@@ -707,6 +712,14 @@ int __cvmx_helper_board_hardware_enable(int interface)
 				}
 			}
 		}
+	} else if (cvmx_sysinfo_get()->board_type ==
+			CVMX_BOARD_TYPE_UBNT_E100) {
+		cvmx_write_csr(CVMX_ASXX_RX_CLK_SETX(0, interface), 0);
+		cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(0, interface), 0x10);
+		cvmx_write_csr(CVMX_ASXX_RX_CLK_SETX(1, interface), 0);
+		cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(1, interface), 0x10);
+		cvmx_write_csr(CVMX_ASXX_RX_CLK_SETX(2, interface), 0);
+		cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(2, interface), 0x10);
 	}
 	return 0;
 }
diff --git a/arch/mips/include/asm/octeon/cvmx-bootinfo.h b/arch/mips/include/asm/octeon/cvmx-bootinfo.h
index 284fa8d..7b7818d 100644
--- a/arch/mips/include/asm/octeon/cvmx-bootinfo.h
+++ b/arch/mips/include/asm/octeon/cvmx-bootinfo.h
@@ -227,6 +227,7 @@ enum cvmx_board_types_enum {
 	 * use any numbers in this range.
 	 */
 	CVMX_BOARD_TYPE_CUST_PRIVATE_MIN = 20001,
+	CVMX_BOARD_TYPE_UBNT_E100 = 20002,
 	CVMX_BOARD_TYPE_CUST_PRIVATE_MAX = 30000,
 
 	/* The remaining range is reserved for future use. */
@@ -325,6 +326,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_PRIVATE_MAX)
 	}
 	return "Unsupported Board";
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once
  2013-05-26 20:35 [PATCH 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once Aaro Koskinen
  2013-05-26 20:35 ` [PATCH 2/2] MIPS: cavium-octeon: enable interfaces on EdgeRouter Lite Aaro Koskinen
@ 2013-05-27 10:19 ` Sergei Shtylyov
  2013-05-27 17:17   ` Sergei Shtylyov
  1 sibling, 1 reply; 4+ messages in thread
From: Sergei Shtylyov @ 2013-05-27 10:19 UTC (permalink / raw)
  To: Aaro Koskinen; +Cc: Ralf Baechle, linux-mips, linux-kernel

Hello.

On 27-05-2013 0:35, Aaro Koskinen wrote:

> When booting a new board for the first time, the console is flooded with
> "Unknown board" messages. This is not really helpful. Board type is not
> going to change after the boot, so it's sufficient to print the warning
> only once.

> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> ---
>   arch/mips/cavium-octeon/executive/cvmx-helper-board.c |    5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)

> diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
> index 7c64977..e0451a0 100644
> --- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
> +++ b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
[...]
> @@ -184,8 +186,7 @@ int cvmx_helper_board_get_mii_address(int ipd_port)
>   	}
>
>   	/* Some unknown board. Somebody forgot to update this function... */
> -	cvmx_dprintf
> -	    ("cvmx_helper_board_get_mii_address: Unknown board type %d\n",
> +	pr_warn_once("%s: Unknown board type %d\n", __func__,
>   	     cvmx_sysinfo_get()->board_type);

    Please align this line under the next char under (.

WVR, Sergei


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once
  2013-05-27 10:19 ` [PATCH 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once Sergei Shtylyov
@ 2013-05-27 17:17   ` Sergei Shtylyov
  0 siblings, 0 replies; 4+ messages in thread
From: Sergei Shtylyov @ 2013-05-27 17:17 UTC (permalink / raw)
  To: Aaro Koskinen; +Cc: Ralf Baechle, linux-mips, linux-kernel

On 27-05-2013 14:19, Sergei Shtylyov wrote:

>> When booting a new board for the first time, the console is flooded with
>> "Unknown board" messages. This is not really helpful. Board type is not
>> going to change after the boot, so it's sufficient to print the warning
>> only once.

>> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
>> ---
>>   arch/mips/cavium-octeon/executive/cvmx-helper-board.c |    5 +++--
>>   1 file changed, 3 insertions(+), 2 deletions(-)

>> diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
>> b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
>> index 7c64977..e0451a0 100644
>> --- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
>> +++ b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
> [...]
>> @@ -184,8 +186,7 @@ int cvmx_helper_board_get_mii_address(int ipd_port)
>>       }
>>
>>       /* Some unknown board. Somebody forgot to update this
>> function... */
>> -    cvmx_dprintf
>> -        ("cvmx_helper_board_get_mii_address: Unknown board type %d\n",
>> +    pr_warn_once("%s: Unknown board type %d\n", __func__,
>>            cvmx_sysinfo_get()->board_type);

>     Please align this line under the next char under (.

     s/under (/after (/, of course.

WBR, Sergei


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-05-27 17:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-26 20:35 [PATCH 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once Aaro Koskinen
2013-05-26 20:35 ` [PATCH 2/2] MIPS: cavium-octeon: enable interfaces on EdgeRouter Lite Aaro Koskinen
2013-05-27 10:19 ` [PATCH 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once Sergei Shtylyov
2013-05-27 17:17   ` Sergei Shtylyov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.