From c8953e127335cee6f7f8068c648b523bf4d0c647 Mon Sep 17 00:00:00 2001 From: Hiroki Sato Date: Sat, 28 Jul 2012 21:56:24 +0000 Subject: [PATCH] Add support for Marvell 88F6282. Sponsored by: Plat'Home, Co.,Ltd. --- sys/arm/mv/common.c | 15 +++++++++++++-- sys/arm/mv/gpio.c | 3 ++- sys/arm/mv/ic.c | 4 +++- sys/arm/mv/kirkwood/kirkwood.c | 2 ++ sys/arm/mv/mv_sata.c | 1 + sys/arm/mv/mvreg.h | 1 + sys/dev/cesa/cesa.c | 1 + sys/dev/mge/if_mge.c | 4 +++- sys/dev/mvs/mvs_soc.c | 1 + 9 files changed, 27 insertions(+), 5 deletions(-) diff --git a/sys/arm/mv/common.c b/sys/arm/mv/common.c index 06104f108c68..b451bf4e8c4f 100644 --- a/sys/arm/mv/common.c +++ b/sys/arm/mv/common.c @@ -251,7 +251,9 @@ cpu_extra_feat(void) uint32_t ef = 0; soc_id(&dev, &rev); - if (dev == MV_DEV_88F6281 || dev == MV_DEV_MV78100_Z0 || + if (dev == MV_DEV_88F6281 || + dev == MV_DEV_88F6282 || + dev == MV_DEV_MV78100_Z0 || dev == MV_DEV_MV78100) __asm __volatile("mrc p15, 1, %0, c15, c1, 0" : "=r" (ef)); else if (dev == MV_DEV_88F5182 || dev == MV_DEV_88F5281) @@ -351,6 +353,13 @@ soc_identify(void) else if (r == 3) rev = "A1"; break; + case MV_DEV_88F6282: + dev = "Marvell 88F6282"; + if (r == 0) + rev = "A0"; + else if (r == 1) + rev = "A1"; + break; case MV_DEV_MV78100_Z0: dev = "Marvell MV78100 Z0"; break; @@ -536,6 +545,7 @@ win_cpu_can_remap(int i) if ((dev == MV_DEV_88F5182 && i < 2) || (dev == MV_DEV_88F5281 && i < 4) || (dev == MV_DEV_88F6281 && i < 4) || + (dev == MV_DEV_88F6282 && i < 4) || (dev == MV_DEV_MV78100 && i < 8) || (dev == MV_DEV_MV78100_Z0 && i < 8)) return (1); @@ -1320,7 +1330,8 @@ xor_max_eng(void) uint32_t dev, rev; soc_id(&dev, &rev); - if (dev == MV_DEV_88F6281) + if (dev == MV_DEV_88F6281 || + dev == MV_DEV_88F6282) return (2); else if ((dev == MV_DEV_MV78100) || (dev == MV_DEV_MV78100_Z0)) return (1); diff --git a/sys/arm/mv/gpio.c b/sys/arm/mv/gpio.c index ffcab1400712..7e4ae53bfff9 100644 --- a/sys/arm/mv/gpio.c +++ b/sys/arm/mv/gpio.c @@ -155,7 +155,8 @@ mv_gpio_attach(device_t dev) sc->pin_num = 32; sc->irq_num = 4; - } else if (dev_id == MV_DEV_88F6281) { + } else if (dev_id == MV_DEV_88F6281 || + dev_id == MV_DEV_88F6282) { sc->pin_num = 50; sc->irq_num = 7; diff --git a/sys/arm/mv/ic.c b/sys/arm/mv/ic.c index 14c6b7b92fac..96159a775bce 100644 --- a/sys/arm/mv/ic.c +++ b/sys/arm/mv/ic.c @@ -105,7 +105,9 @@ mv_ic_attach(device_t dev) sc->ic_high_regs = 0; sc->ic_error_regs = 0; - if (dev_id == MV_DEV_88F6281 || dev_id == MV_DEV_MV78100 || + if (dev_id == MV_DEV_88F6281 || + dev_id == MV_DEV_88F6282 || + dev_id == MV_DEV_MV78100 || dev_id == MV_DEV_MV78100_Z0) sc->ic_high_regs = 1; diff --git a/sys/arm/mv/kirkwood/kirkwood.c b/sys/arm/mv/kirkwood/kirkwood.c index 7b0d88a1ffb6..e6fd44275972 100644 --- a/sys/arm/mv/kirkwood/kirkwood.c +++ b/sys/arm/mv/kirkwood/kirkwood.c @@ -74,6 +74,8 @@ get_tclk(void) soc_id(&dev, &rev); if (dev == MV_DEV_88F6281 && (rev == 2 || rev == 3)) return (TCLK_200MHZ); + if (dev == MV_DEV_88F6282) + return (TCLK_200MHZ); return (TCLK_166MHZ); } diff --git a/sys/arm/mv/mv_sata.c b/sys/arm/mv/mv_sata.c index 277c837ed233..28c641f97d57 100644 --- a/sys/arm/mv/mv_sata.c +++ b/sys/arm/mv/mv_sata.c @@ -197,6 +197,7 @@ sata_probe(device_t dev) sc->sc_edma_qlen = 128; break; case MV_DEV_88F6281: + case MV_DEV_88F6282: case MV_DEV_MV78100: case MV_DEV_MV78100_Z0: sc->sc_version = 2; diff --git a/sys/arm/mv/mvreg.h b/sys/arm/mv/mvreg.h index 87c93e54ee61..398fa15c7ae5 100644 --- a/sys/arm/mv/mvreg.h +++ b/sys/arm/mv/mvreg.h @@ -326,6 +326,7 @@ #define MV_DEV_88F5182 0x5182 #define MV_DEV_88F5281 0x5281 #define MV_DEV_88F6281 0x6281 +#define MV_DEV_88F6282 0x6282 #define MV_DEV_MV78100_Z0 0x6381 #define MV_DEV_MV78100 0x7810 diff --git a/sys/dev/cesa/cesa.c b/sys/dev/cesa/cesa.c index 9c758a419bba..835bb06c1a31 100644 --- a/sys/dev/cesa/cesa.c +++ b/sys/dev/cesa/cesa.c @@ -1005,6 +1005,7 @@ cesa_attach(device_t dev) switch (d) { case MV_DEV_88F6281: + case MV_DEV_88F6282: sc->sc_tperr = 0; break; case MV_DEV_MV78100: diff --git a/sys/dev/mge/if_mge.c b/sys/dev/mge/if_mge.c index 5b0ede35bfa7..94377936ade9 100644 --- a/sys/dev/mge/if_mge.c +++ b/sys/dev/mge/if_mge.c @@ -258,7 +258,9 @@ mge_ver_params(struct mge_softc *sc) uint32_t d, r; soc_id(&d, &r); - if (d == MV_DEV_88F6281 || d == MV_DEV_MV78100 || + if (d == MV_DEV_88F6281 || + d == MV_DEV_88F6282 || + d == MV_DEV_MV78100 || d == MV_DEV_MV78100_Z0) { sc->mge_ver = 2; sc->mge_mtu = 0x4e8; diff --git a/sys/dev/mvs/mvs_soc.c b/sys/dev/mvs/mvs_soc.c index 9e9f93ea8f78..9f48fddaaa7a 100644 --- a/sys/dev/mvs/mvs_soc.c +++ b/sys/dev/mvs/mvs_soc.c @@ -63,6 +63,7 @@ static struct { } mvs_ids[] = { {MV_DEV_88F5182, 0x00, "Marvell 88F5182", 2, MVS_Q_GENIIE|MVS_Q_SOC}, {MV_DEV_88F6281, 0x00, "Marvell 88F6281", 2, MVS_Q_GENIIE|MVS_Q_SOC}, + {MV_DEV_88F6282, 0x00, "Marvell 88F6282", 2, MVS_Q_GENIIE|MVS_Q_SOC}, {MV_DEV_MV78100, 0x00, "Marvell MV78100", 2, MVS_Q_GENIIE|MVS_Q_SOC}, {MV_DEV_MV78100_Z0, 0x00,"Marvell MV78100", 2, MVS_Q_GENIIE|MVS_Q_SOC}, {0, 0x00, NULL, 0, 0}