aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/files/drivers
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2009-07-02 17:23:11 +0000
committerGabor Juhos <juhosg@openwrt.org>2009-07-02 17:23:11 +0000
commit0fd8d0fad8c5f4b6d04ae2497c479ff43a38b5da (patch)
treea17d4c595475802b678c0a472634459b1dcb909b /target/linux/ar71xx/files/drivers
parentd413a9639e91a34899b1366c08d9772b1ca3beb1 (diff)
downloadupstream-0fd8d0fad8c5f4b6d04ae2497c479ff43a38b5da.tar.gz
upstream-0fd8d0fad8c5f4b6d04ae2497c479ff43a38b5da.tar.bz2
upstream-0fd8d0fad8c5f4b6d04ae2497c479ff43a38b5da.zip
fix a bitmask in the ag71xx driver
SVN-Revision: 16658
Diffstat (limited to 'target/linux/ar71xx/files/drivers')
-rw-r--r--target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx.h b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx.h
index 1d22453a97..9037b13d74 100644
--- a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx.h
+++ b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx.h
@@ -82,7 +82,7 @@ struct ag71xx_desc {
u32 ctrl;
#define DESC_EMPTY BIT(31)
#define DESC_MORE BIT(24)
-#define DESC_PKTLEN_M 0x1fff
+#define DESC_PKTLEN_M 0xfff
u32 next;
u32 pad;
};
ubheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -57,3 +57,4 @@ obj-$(CONFIG_GENWQE)		+= genwqe/
 obj-$(CONFIG_ECHO)		+= echo/
 obj-$(CONFIG_VEXPRESS_SYSCFG)	+= vexpress-syscfg.o
 obj-$(CONFIG_CXL_BASE)		+= cxl/
+obj-$(CONFIG_SOC_MT7620)	+= linkit.o
--- /dev/null
+++ b/drivers/misc/linkit.c
@@ -0,0 +1,84 @@
+/*
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  publishhed by the Free Software Foundation.
+ *
+ *  Copyright (C) 2015 John Crispin <blogic@openwrt.org>
+ */
+
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/of.h>
+#include <linux/mtd/mtd.h>
+#include <linux/gpio.h>
+
+#define LINKIT_LATCH_GPIO	11
+
+struct linkit_hw_data {
+	char board[16];
+	char rev[16];
+};
+
+static void sanify_string(char *s)
+{
+	int i;
+
+	for (i = 0; i < 15; i++)
+		if (s[i] <= 0x20)
+			s[i] = '\0';
+	s[15] = '\0';
+}
+
+static int linkit_probe(struct platform_device *pdev)
+{
+	struct linkit_hw_data hw;
+	struct mtd_info *mtd;
+	size_t retlen;
+	int ret;
+
+	mtd = get_mtd_device_nm("factory");
+	if (IS_ERR(mtd))
+		return PTR_ERR(mtd);
+
+	ret = mtd_read(mtd, 0x400, sizeof(hw), &retlen, (u_char *) &hw);
+	put_mtd_device(mtd);
+
+	sanify_string(hw.board);
+	sanify_string(hw.rev);
+
+	dev_info(&pdev->dev, "Version  : %s\n", hw.board);
+	dev_info(&pdev->dev, "Revision : %s\n", hw.rev);
+
+	if (!strcmp(hw.board, "LINKITS7688")) {
+		dev_info(&pdev->dev, "setting up bootstrap latch\n");
+
+		if (devm_gpio_request(&pdev->dev, LINKIT_LATCH_GPIO, "bootstrap")) {
+			dev_err(&pdev->dev, "failed to setup bootstrap gpio\n");
+			return -1;
+		}
+		gpio_direction_output(LINKIT_LATCH_GPIO, 0);
+	}
+
+	return 0;
+}
+
+static const struct of_device_id linkit_match[] = {
+	{ .compatible = "mediatek,linkit" },
+	{},
+};
+MODULE_DEVICE_TABLE(of, linkit_match);
+
+static struct platform_driver linkit_driver = {
+	.probe = linkit_probe,
+	.driver = {
+		.name = "mtk-linkit",
+		.owner = THIS_MODULE,
+		.of_match_table = linkit_match,
+	},
+};
+
+int __init linkit_init(void)
+{
+	return platform_driver_register(&linkit_driver);
+}
+late_initcall_sync(linkit_init);