-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathlinux.patch
More file actions
1707 lines (1666 loc) · 44.4 KB
/
linux.patch
File metadata and controls
1707 lines (1666 loc) · 44.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
diff -uNr linux-3.17.7/arch/arm/mach-at91/at91sam9g45_devices.c linux.octonet/arch/arm/mach-at91/at91sam9g45_devices.c
--- linux-3.17.7/arch/arm/mach-at91/at91sam9g45_devices.c 2014-12-16 18:37:26.000000000 +0100
+++ linux.octonet/arch/arm/mach-at91/at91sam9g45_devices.c 2014-12-19 01:29:03.337952422 +0100
@@ -304,7 +304,7 @@
},
};
-static struct platform_device at91sam9g45_eth_device = {
+struct platform_device at91sam9g45_eth_device = {
.name = "macb",
.id = -1,
.dev = {
diff -uNr linux-3.17.7/arch/arm/mach-at91/board-octonet.c linux.octonet/arch/arm/mach-at91/board-octonet.c
--- linux-3.17.7/arch/arm/mach-at91/board-octonet.c 1970-01-01 01:00:00.000000000 +0100
+++ linux.octonet/arch/arm/mach-at91/board-octonet.c 2014-12-19 01:29:03.337952422 +0100
@@ -0,0 +1,472 @@
+/*
+ * Board-specific setup code for the AT91SAM9M10G45 Evaluation Kit family
+ *
+ * Covers: * AT91SAM9G45-EKES board
+ * * AT91SAM9M10G45-EK board
+ *
+ * Copyright (C) 2009 Atmel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ */
+
+#include <linux/types.h>
+#include <linux/gpio.h>
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/spi/spi.h>
+#include <linux/fb.h>
+#include <linux/gpio_keys.h>
+#include <linux/input.h>
+#include <linux/leds.h>
+#include <linux/atmel-mci.h>
+#include <linux/delay.h>
+#include <linux/netdevice.h>
+#include <linux/phy.h>
+#include <linux/interrupt.h>
+#include <linux/input.h>
+#include <net/dsa.h>
+
+#include <linux/platform_data/at91_adc.h>
+
+#include <mach/hardware.h>
+#include <video/atmel_lcdc.h>
+#include <media/soc_camera.h>
+#include <media/atmel-isi.h>
+
+#include <asm/setup.h>
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <mach/at91sam9_smc.h>
+#include <mach/system_rev.h>
+
+#include "at91_aic.h"
+#include "at91_shdwc.h"
+#include "board.h"
+#include "sam9_smc.h"
+#include "generic.h"
+#include "gpio.h"
+
+#include <linux/clk.h>
+#include "clock.h"
+
+#define SCKCR (0xd50)
+
+static void set_alarm(void)
+{
+ void __iomem *r = ioremap(0xfffff000, 0x1000);
+
+ if (!r)
+ return;
+ writel(0x02, r + 0xdcc); /* reset ALARM clock state */
+ iounmap(r);
+}
+
+static void set_slowclock(void)
+{
+ void __iomem *r = ioremap(0xfffff000, 0x1000);
+
+ if (!r)
+ return;
+ //writel(0x02, r + 0xdcc); /* reset ALARM clock state */
+ if (readl(r + SCKCR) == 1) {
+ writel(0x03, r + SCKCR);
+ mdelay(1400);
+ writel(0x0b, r + SCKCR);
+ mdelay(1);
+ writel(0x0a, r + SCKCR);
+ }
+ iounmap(r);
+}
+
+
+static void __init octonet_init_early(void)
+{
+ /* Initialize processor: 12.000 MHz crystal */
+ at91_initialize(12000000);
+
+ set_alarm();
+}
+
+/*
+ * USB HS Host port (common to OHCI & EHCI)
+ */
+static struct at91_usbh_data __initdata ek_usbh_hs_data = {
+ .ports = 2,
+ .vbus_pin = {-1, -1},
+ .vbus_pin_active_low = {1, 1},
+ .overcurrent_pin= {-EINVAL, -EINVAL},
+};
+
+
+/*
+ * USB HS Device port
+ */
+static struct usba_platform_data __initdata ek_usba_udc_data = {
+ .vbus_pin = AT91_PIN_PB19,
+};
+
+/*
+ * MACB Ethernet device
+ */
+static struct macb_platform_data __initdata ek_macb_data = {
+ .phy_irq_pin = 0,
+ .is_rmii = 0,
+};
+
+/*
+ * NAND flash
+ */
+static struct mtd_partition __initdata ek_nand_partition[] = {
+ {
+ .name = "boot",
+ .offset = 0,
+ .size = 0x100000,
+ },
+ {
+ .name = "linux",
+ .offset = MTDPART_OFS_NXTBLK,
+ .size = 0x1f00000,
+ },
+ {
+ .name = "ubi",
+ .offset = MTDPART_OFS_NXTBLK,
+ .size = MTDPART_SIZ_FULL,
+ },
+};
+
+static struct atmel_nand_data __initdata ek_nand_data = {
+ .ale = 21,
+ .cle = 22,
+ .rdy_pin = AT91_PIN_PC8,
+ .enable_pin = AT91_PIN_PC14,
+ .det_pin = -EINVAL,
+ .ecc_mode = NAND_ECC_SOFT_BCH,
+ .ecc_size = 512,
+ .ecc_bytes = 13,
+ .on_flash_bbt = 1,
+ .parts = ek_nand_partition,
+ .num_parts = ARRAY_SIZE(ek_nand_partition),
+ .bus_width_16 = 0,
+};
+
+static struct sam9_smc_config __initdata ek_nand_smc_config = {
+ .ncs_read_setup = 0,
+ .nrd_setup = 2,
+ .ncs_write_setup = 0,
+ .nwe_setup = 2,
+
+ .ncs_read_pulse = 4,
+ .nrd_pulse = 4,
+ .ncs_write_pulse = 4,
+ .nwe_pulse = 4,
+
+ .read_cycle = 7,
+ .write_cycle = 7,
+
+ .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE,
+ .tdf_cycles = 3,
+};
+
+static void __init ek_add_device_nand(void)
+{
+ /* setup bus-width (8 or 16) */
+ if (ek_nand_data.bus_width_16)
+ ek_nand_smc_config.mode |= AT91_SMC_DBW_16;
+ else
+ ek_nand_smc_config.mode |= AT91_SMC_DBW_8;
+
+ /* configure chip-select 3 (NAND) */
+ sam9_smc_configure(0, 3, &ek_nand_smc_config);
+
+ at91_add_device_nand(&ek_nand_data);
+}
+
+static struct resource octonet_dvb_resources[2] = {
+ [0] = {
+ .start = 0x30000000,
+ .end = 0x30000000 + SZ_64K - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = 0,
+ .end = 0,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static void octonet_dvb_release(struct device *dev)
+{
+
+}
+
+static struct platform_device octonet_dvb_device = {
+ .name = "octonet-dvb",
+ .id = 0,
+ .dev = {
+ .release = octonet_dvb_release,
+ },
+ .resource = octonet_dvb_resources,
+ .num_resources = ARRAY_SIZE(octonet_dvb_resources),
+};
+
+static void __init add_octonet_dvb(void)
+{
+ u32 gpio = AT91_PIN_PC15;
+
+ at91_set_GPIO_periph(gpio, 0);
+ at91_set_gpio_input(gpio, 0);
+ at91_set_deglitch(gpio, 0);
+ octonet_dvb_device.resource[1].start = gpio_to_irq(gpio);
+ octonet_dvb_device.resource[1].end = gpio_to_irq(gpio);
+ platform_device_register(&octonet_dvb_device);
+}
+
+
+static struct gpio_keys_button octonet_buttons[] = {
+ {
+ .code = KEY_POWER,
+ .gpio = AT91_PIN_PC12,
+ .active_low = 1,
+ .desc = "power",
+ .wakeup = 1,
+ .type = EV_KEY,
+ },
+};
+
+static struct gpio_keys_platform_data octonet_button_data = {
+ .buttons = octonet_buttons,
+ .nbuttons = ARRAY_SIZE(octonet_buttons),
+};
+
+static struct platform_device octonet_button_device = {
+ .name = "gpio-keys",
+ .id = -1,
+ .num_resources = 0,
+ .dev = {
+ .platform_data = &octonet_button_data,
+ }
+};
+
+static void __init octonet_add_buttons(void)
+{
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(octonet_buttons); i++) {
+ at91_set_GPIO_periph(octonet_buttons[i].gpio, 1);
+ at91_set_deglitch(octonet_buttons[i].gpio, 1);
+ }
+ platform_device_register(&octonet_button_device);
+}
+
+
+static struct input_dev *pwr;
+static struct timer_list pwr_timer;
+
+static void pwr_timer_func(unsigned long ptr)
+{
+ input_event(pwr, EV_KEY, KEY_POWER, 1);
+ input_event(pwr, EV_KEY, KEY_POWER, 0);
+ input_sync(pwr);
+}
+
+
+#if 0
+static irqreturn_t pwr_irq(int irq, void *dev_id)
+{
+ u32 val = gpio_get_value(AT91_PIN_PC12);
+ static int sw = 0;
+
+ if (val & 1) {
+ if (del_timer(&pwr_timer)) {
+ sw ^= 1;
+ input_event(pwr, EV_KEY, KEY_PAUSE, sw);
+ input_sync(pwr);
+ }
+ } else {
+ mod_timer(&pwr_timer, jiffies + 3 * HZ);
+ }
+ //input_event(pwr, EV_KEY, KEY_POWER, val ^ 1);
+ //input_sync(pwr);
+ return IRQ_HANDLED;
+}
+#else
+static irqreturn_t pwr_irq(int irq, void *dev_id)
+{
+ u32 val = gpio_get_value(AT91_PIN_PC12);
+ static int sw = 0;
+
+ input_event(pwr, EV_KEY, KEY_POWER, val ^ 1);
+ input_sync(pwr);
+ return IRQ_HANDLED;
+}
+#endif
+
+static void __init add_octonet_button(void)
+{
+ u32 gpio = AT91_PIN_PC12;
+ u32 irq;
+
+ at91_set_GPIO_periph(gpio, 0);
+ at91_set_gpio_input(gpio, 0);
+ at91_set_deglitch(gpio, 0);
+
+ init_timer(&pwr_timer);
+ pwr_timer.function = pwr_timer_func;
+ pwr_timer.data = 0;
+ pwr = input_allocate_device();
+ if (!pwr) {
+ printk("could not allocate input device\n");
+ return;
+ }
+
+ set_bit(EV_KEY, pwr->evbit);
+ set_bit(KEY_POWER, pwr->keybit);
+ set_bit(KEY_PAUSE, pwr->keybit);
+ pwr->name = "octonet_pwr";
+ pwr->phys = "octonet_pwr/input0";
+
+ irq = gpio_to_irq(gpio);
+ request_irq(irq, pwr_irq, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "pwr", NULL);
+
+ input_register_device(pwr);
+}
+
+static struct dsa_chip_data switch_chip_data = {
+ .port_names[0] = "lan1",
+ .port_names[1] = "lan2",
+ .port_names[2] = "lan3",
+ .port_names[3] = "lan4",
+ .port_names[4] = "lan5",
+ .port_names[5] = "cpu",
+ .port_names[6] = "fpga",
+};
+
+static struct dsa_platform_data switch_data = {
+ .nr_chips = 1,
+ .chip = &switch_chip_data,
+};
+
+static struct resource switch_resources[] = {
+ {
+ .start = 0,
+ .end = 0,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct platform_device switch_device = {
+ .name = "dsa",
+ .id = 0,
+ .num_resources = 0,
+ .resource = switch_resources,
+ .dev.platform_data = &switch_data,
+};
+
+extern struct platform_device at91sam9g45_eth_device;
+
+static void __init add_switch(void)
+{
+ int i;
+ struct platform_device *pdev = &at91sam9g45_eth_device;
+ struct net_device *netdev = platform_get_drvdata(pdev);
+ struct mii_bus *mii = (struct mii_bus *) dev_get_drvdata(&netdev->dev);
+
+// printk("%08x %08x %08x\n", (u32) pdev, (u32) netdev, (u32) &netdev->dev);
+ switch_data.netdev = &netdev->dev;
+ for (i=0; i<5; i++)
+ switch_data.chip[i].mii_bus = &mii->dev;
+ platform_device_register(&switch_device);
+}
+
+
+
+static void set_pck(void)
+{
+ struct clk *pck0, *mck;
+ int res;
+
+ pck0 = clk_get(NULL, "pck0");
+
+ clk_enable(pck0);
+ return;
+
+
+ mck = clk_get(NULL, "mck");
+ at91_set_A_periph(AT91_PIN_PD26, 0);
+
+ printk("pck=%08x %d, mck=%08x %d\n",
+ (u32) pck0, pck0->type, (u32) mck, mck->type);
+
+ res = clk_set_parent(pck0, mck);
+ printk("set_parent = %d\n", res);
+ //clk_put(mck);
+
+}
+
+#include <mach/at91sam9g45_matrix.h>
+#include <mach/at91_matrix.h>
+
+#undef AT91_SCKCR
+#define AT91_SCKCR (void __iomem *)(0xfffffd50)
+
+static void octonet_init(void)
+{
+ //at91_matrix_write(AT91_MATRIX_EBICSA, 0x0001000a);
+
+ /* DGBU on ttyS0. (Rx & Tx only) */
+ at91_register_uart(0, 0, 0);
+ at91_add_device_serial();
+
+ /* USB HS Host */
+ at91_add_device_usbh_ohci(&ek_usbh_hs_data);
+ at91_add_device_usbh_ehci(&ek_usbh_hs_data);
+ /* USB HS Device */
+ //at91_add_device_usba(&ek_usba_udc_data);
+ /* Ethernet */
+ at91_add_device_eth(&ek_macb_data);
+
+ at91_set_gpio_input(AT91_PIN_PA19, 0);
+ at91_set_gpio_input(AT91_PIN_PA18, 0);
+
+ at91_matrix_write(AT91_MATRIX_SCFG4, (8<<18)|(2<<16));
+ at91_matrix_write(AT91_MATRIX_PRBS4, 0x00000003);
+ //at91_matrix_write(AT91_MATRIX_SCFG5, (8<<18)|(2<<16));
+ //at91_matrix_write(AT91_MATRIX_PRBS5, 0x00000003);
+ //at91_matrix_write(AT91_MATRIX_VIDEO, AT91C_VDEC_SEL_OFF);
+ ek_add_device_nand();
+ //at91_add_device_i2c(0, NULL, 0);
+ add_octonet_dvb();
+
+ set_pck();
+
+ at91_shdwc_write(AT91_SHDW_MR, 0x30003);
+ //octonet_add_buttons();
+ set_slowclock();
+}
+
+static void octonet_init_late(void)
+{
+ add_switch();
+ add_octonet_button();
+}
+
+MACHINE_START(NAXY400, "DigitalDevices OctopusNet")
+ .init_time = at91sam926x_pit_init,
+ .map_io = at91_map_io,
+ .handle_irq = at91_aic_handle_irq,
+ .init_early = octonet_init_early,
+ .init_irq = at91_init_irq_default,
+ .init_machine = octonet_init,
+ .init_late = octonet_init_late,
+MACHINE_END
diff -uNr linux-3.17.7/arch/arm/mach-at91/Kconfig.non_dt linux.octonet/arch/arm/mach-at91/Kconfig.non_dt
--- linux-3.17.7/arch/arm/mach-at91/Kconfig.non_dt 2014-12-16 18:37:26.000000000 +0100
+++ linux.octonet/arch/arm/mach-at91/Kconfig.non_dt 2014-12-19 01:29:03.337952422 +0100
@@ -319,6 +319,11 @@
families: AT91SAM9G45, AT91SAM9G46, AT91SAM9M10 and AT91SAM9M11.
<http://www.atmel.com/tools/SAM9M10-G45-EK.aspx>
+config MACH_OCTONET
+ bool "OctoNet"
+ help
+ OctoNet
+
endif
# ----------------------------------------------------------
diff -uNr linux-3.17.7/arch/arm/mach-at91/Makefile linux.octonet/arch/arm/mach-at91/Makefile
--- linux-3.17.7/arch/arm/mach-at91/Makefile 2014-12-16 18:37:26.000000000 +0100
+++ linux.octonet/arch/arm/mach-at91/Makefile 2014-12-19 01:29:05.902083522 +0100
@@ -80,6 +80,7 @@
# AT91SAM9G45 board-specific support
obj-$(CONFIG_MACH_AT91SAM9M10G45EK) += board-sam9m10g45ek.o
+obj-$(CONFIG_MACH_OCTONET) += board-octonet.o
# AT91SAM board with device-tree
obj-$(CONFIG_MACH_AT91RM9200_DT) += board-dt-rm9200.o
diff -uNr linux-3.17.7/arch/arm/tools/mach-types linux.octonet/arch/arm/tools/mach-types
--- linux-3.17.7/arch/arm/tools/mach-types 2014-12-16 18:37:26.000000000 +0100
+++ linux.octonet/arch/arm/tools/mach-types 2014-12-19 01:29:06.702124427 +0100
@@ -517,6 +517,7 @@
cm_a510 MACH_CM_A510 CM_A510 3020
tx28 MACH_TX28 TX28 3043
pcontrol_g20 MACH_PCONTROL_G20 PCONTROL_G20 3062
+naxy400 MACH_NAXY400 NAXY400 3085
vpr200 MACH_VPR200 VPR200 3087
torbreck MACH_TORBRECK TORBRECK 3090
prima2_evb MACH_PRIMA2_EVB PRIMA2_EVB 3103
diff -uNr linux-3.17.7/drivers/media/dvb-core/Makefile linux.octonet/drivers/media/dvb-core/Makefile
--- linux-3.17.7/drivers/media/dvb-core/Makefile 2014-12-16 18:37:26.000000000 +0100
+++ linux.octonet/drivers/media/dvb-core/Makefile 2014-12-19 01:29:06.702124427 +0100
@@ -6,6 +6,7 @@
dvb-core-objs := dvbdev.o dmxdev.o dvb_demux.o dvb_filter.o \
dvb_ca_en50221.o dvb_frontend.o \
- $(dvb-net-y) dvb_ringbuffer.o dvb_math.o
+ $(dvb-net-y) dvb_ringbuffer.o dvb_math.o \
+ dvb_netstream.o
obj-$(CONFIG_DVB_CORE) += dvb-core.o
diff -uNr linux-3.17.7/drivers/media/dvb-frontends/Kconfig linux.octonet/drivers/media/dvb-frontends/Kconfig
--- linux-3.17.7/drivers/media/dvb-frontends/Kconfig 2014-12-16 18:37:26.000000000 +0100
+++ linux.octonet/drivers/media/dvb-frontends/Kconfig 2014-12-19 01:29:06.702124427 +0100
@@ -35,6 +35,29 @@
help
A Silicon tuner that supports DVB-S and DVB-S2 modes
+config DVB_STV0910
+ tristate "STV0910 based"
+ depends on DVB_CORE && I2C
+ default m if !MEDIA_SUBDRV_AUTOSELECT
+ help
+ DVB-S/S2/DSS Multistandard Professional/Broadcast demodulators.
+ Say Y when you want to support these frontends.
+
+config DVB_MXL5XX
+ tristate "MXL5XX based"
+ depends on DVB_CORE && I2C
+ default m if !MEDIA_SUBDRV_AUTOSELECT
+ help
+ DVB-S/S2/DSS Multistandard Professional/Broadcast demodulators.
+ Say Y when you want to support these frontends.
+
+config DVB_STV6111
+ tristate "STV6111 based tuners"
+ depends on DVB_CORE && I2C
+ default m if !MEDIA_SUBDRV_AUTOSELECT
+ help
+ A Silicon tuner that supports DVB-S and DVB-S2 modes
+
config DVB_M88DS3103
tristate "Montage M88DS3103"
depends on DVB_CORE && I2C && I2C_MUX
@@ -54,6 +77,7 @@
Say Y when you want to support this frontend.
+
config DVB_TDA18271C2DD
tristate "NXP TDA18271C2 silicon tuner"
depends on DVB_CORE && I2C
@@ -406,6 +430,13 @@
help
A DVB-T tuner module. Say Y when you want to support this frontend.
+config DVB_TDA18212DD
+ tristate "Philips TDA18212 based"
+ depends on DVB_CORE && I2C
+ default m if !MEDIA_SUBDRV_AUTOSELECT
+ help
+ A DVB-T tuner module. Say Y when you want to support this frontend.
+
config DVB_AF9013
tristate "Afatech AF9013 demodulator"
depends on DVB_CORE && I2C
@@ -434,6 +465,20 @@
help
A DVB-T/C tuner module. Say Y when you want to support this frontend.
+config DVB_STV0367DD
+ tristate "ST STV0367dd based"
+ depends on DVB_CORE && I2C
+ default m if !MEDIA_SUBDRV_AUTOSELECT
+ help
+ A DVB-T/C tuner module. Say Y when you want to support this frontend.
+
+config DVB_CXD2843
+ tristate "Sony CXD2843"
+ depends on DVB_CORE && I2C
+ default m if !MEDIA_SUBDRV_AUTOSELECT
+ help
+ A DVB-T/T2/C/C2 tuner module. Say Y when you want to support this frontend.
+
config DVB_CXD2820R
tristate "Sony CXD2820R"
depends on DVB_CORE && I2C
@@ -684,6 +729,13 @@
help
An SEC control chips.
+config DVB_LNBH25
+ tristate "LNBH25 SEC controllers"
+ depends on DVB_CORE && I2C
+ default m if !MEDIA_SUBDRV_AUTOSELECT
+ help
+ An SEC control chips.
+
config DVB_LNBP22
tristate "LNBP22 SEC controllers"
depends on DVB_CORE && I2C
@@ -773,6 +825,11 @@
depends on DVB_CORE && I2C
default m if !MEDIA_SUBDRV_AUTOSELECT
+config DVB_CXD2099
+ tristate "cxd2099"
+ depends on DVB_CORE && I2C
+ default m if !MEDIA_SUBDRV_AUTOSELECT
+
comment "Tools to develop new frontends"
config DVB_DUMMY_FE
diff -uNr linux-3.17.7/drivers/media/dvb-frontends/Makefile linux.octonet/drivers/media/dvb-frontends/Makefile
--- linux-3.17.7/drivers/media/dvb-frontends/Makefile 2014-12-16 18:37:26.000000000 +0100
+++ linux.octonet/drivers/media/dvb-frontends/Makefile 2014-12-19 01:33:36.799941558 +0100
@@ -113,4 +113,11 @@
obj-$(CONFIG_DVB_RTL2832_SDR) += rtl2832_sdr.o
obj-$(CONFIG_DVB_M88RS2000) += m88rs2000.o
obj-$(CONFIG_DVB_AF9033) += af9033.o
-
+obj-$(CONFIG_DVB_STV0367DD) += stv0367dd.o
+obj-$(CONFIG_DVB_TDA18212DD) += tda18212dd.o
+obj-$(CONFIG_DVB_CXD2099) += cxd2099.o
+obj-$(CONFIG_DVB_CXD2843) += cxd2843.o
+obj-$(CONFIG_DVB_STV6111) += stv6111.o
+obj-$(CONFIG_DVB_STV0910) += stv0910.o
+obj-$(CONFIG_DVB_LNBH25) += lnbh25.o
+obj-$(CONFIG_DVB_MXL5XX) += mxl5xx.o
diff -uNr linux-3.17.7/drivers/media/pci/ddbridge/Kconfig linux.octonet/drivers/media/pci/ddbridge/Kconfig
--- linux-3.17.7/drivers/media/pci/ddbridge/Kconfig 2014-12-16 18:37:26.000000000 +0100
+++ linux.octonet/drivers/media/pci/ddbridge/Kconfig 2014-12-19 01:29:06.702124427 +0100
@@ -1,11 +1,16 @@
+
config DVB_DDBRIDGE
tristate "Digital Devices bridge support"
- depends on DVB_CORE && PCI && I2C
+ depends on MEDIA_PCI_SUPPORT && DVB_CORE && PCI && I2C
select DVB_LNBP21 if MEDIA_SUBDRV_AUTOSELECT
select DVB_STV6110x if MEDIA_SUBDRV_AUTOSELECT
select DVB_STV090x if MEDIA_SUBDRV_AUTOSELECT
select DVB_DRXK if MEDIA_SUBDRV_AUTOSELECT
select DVB_TDA18271C2DD if MEDIA_SUBDRV_AUTOSELECT
+ select DVB_TDA18212DD if MEDIA_SUBDRV_AUTOSELECT
+ select DVB_STV0367DD if MEDIA_SUBDRV_AUTOSELECT
+ select DVB_CXD2099 if MEDIA_SUBDRV_AUTOSELECT
+ select DVB_CXD2843 if MEDIA_SUBDRV_AUTOSELECT
---help---
Support for cards with the Digital Devices PCI express bridge:
- Octopus PCIe Bridge
@@ -16,3 +21,25 @@
- cineS2(v6)
Say Y if you own such a card and want to use it.
+
+
+config DVB_OCTONET
+ tristate "Digital Devices octonet support"
+ depends on MEDIA_DIGITAL_TV_SUPPORT && DVB_CORE && I2C
+ select DVB_LNBP21 if MEDIA_SUBDRV_AUTOSELECT
+ select DVB_STV6110x if MEDIA_SUBDRV_AUTOSELECT
+ select DVB_STV090x if MEDIA_SUBDRV_AUTOSELECT
+ select DVB_DRXK if MEDIA_SUBDRV_AUTOSELECT
+ select DVB_TDA18271C2DD if MEDIA_SUBDRV_AUTOSELECT
+ select DVB_TDA18212DD if MEDIA_SUBDRV_AUTOSELECT
+ select DVB_STV0367DD if MEDIA_SUBDRV_AUTOSELECT
+ select DVB_CXD2099 if MEDIA_SUBDRV_AUTOSELECT
+ select DVB_CXD2843 if MEDIA_SUBDRV_AUTOSELECT
+ select DVB_STV0910 if MEDIA_SUBDRV_AUTOSELECT
+ select DVB_STV6111 if MEDIA_SUBDRV_AUTOSELECT
+ select DVB_LNBH25 if MEDIA_SUBDRV_AUTOSELECT
+ select DVB_MXL5XX if MEDIA_SUBDRV_AUTOSELECT
+ ---help---
+ Support for OctopusNet
+
+ Say Y if you own such a card and want to use it.
diff -uNr linux-3.17.7/drivers/media/pci/ddbridge/Makefile linux.octonet/drivers/media/pci/ddbridge/Makefile
--- linux-3.17.7/drivers/media/pci/ddbridge/Makefile 2014-12-16 18:37:26.000000000 +0100
+++ linux.octonet/drivers/media/pci/ddbridge/Makefile 2014-12-19 01:29:06.702124427 +0100
@@ -5,10 +5,9 @@
ddbridge-objs := ddbridge-core.o
obj-$(CONFIG_DVB_DDBRIDGE) += ddbridge.o
+obj-$(CONFIG_DVB_OCTONET) += octonet.o
ccflags-y += -Idrivers/media/dvb-core/
ccflags-y += -Idrivers/media/dvb-frontends/
ccflags-y += -Idrivers/media/tuners/
-# For the staging CI driver cxd2099
-ccflags-y += -Idrivers/staging/media/cxd2099/
diff -uNr linux-3.17.7/drivers/media/pci/Kconfig linux.octonet/drivers/media/pci/Kconfig
--- linux-3.17.7/drivers/media/pci/Kconfig 2014-12-16 18:37:26.000000000 +0100
+++ linux.octonet/drivers/media/pci/Kconfig 2014-12-19 01:29:06.702124427 +0100
@@ -43,8 +43,9 @@
source "drivers/media/pci/pt1/Kconfig"
source "drivers/media/pci/mantis/Kconfig"
source "drivers/media/pci/ngene/Kconfig"
-source "drivers/media/pci/ddbridge/Kconfig"
endif
endif #MEDIA_PCI_SUPPORT
endif #PCI
+
+source "drivers/media/pci/ddbridge/Kconfig"
diff -uNr linux-3.17.7/drivers/mtd/nand/atmel_nand.c linux.octonet/drivers/mtd/nand/atmel_nand.c
--- linux-3.17.7/drivers/mtd/nand/atmel_nand.c 2014-12-16 18:37:26.000000000 +0100
+++ linux.octonet/drivers/mtd/nand/atmel_nand.c 2014-12-19 01:30:14.845609001 +0100
@@ -2099,6 +2099,8 @@
}
nand_chip->ecc.mode = host->board.ecc_mode;
+ nand_chip->ecc.size = host->board.ecc_size;
+ nand_chip->ecc.bytes = host->board.ecc_bytes;
nand_chip->chip_delay = 20; /* 20us command delay time */
if (host->board.bus_width_16) /* 16-bit bus width */
diff -uNr linux-3.17.7/drivers/net/ethernet/cadence/macb.c linux.octonet/drivers/net/ethernet/cadence/macb.c
--- linux-3.17.7/drivers/net/ethernet/cadence/macb.c 2014-12-16 18:37:26.000000000 +0100
+++ linux.octonet/drivers/net/ethernet/cadence/macb.c 2014-12-19 01:29:08.054193557 +0100
@@ -316,6 +316,7 @@
int phy_irq;
int ret;
+#ifndef CONFIG_MACH_OCTONET
phydev = phy_find_first(bp->mii_bus);
if (!phydev) {
netdev_err(dev, "no PHY found\n");
@@ -351,7 +352,7 @@
bp->speed = 0;
bp->duplex = -1;
bp->phy_dev = phydev;
-
+#endif
return 0;
}
@@ -1714,9 +1715,11 @@
/* carrier starts down */
netif_carrier_off(dev);
+#ifndef CONFIG_MACH_OCTONET
/* if the phy is not yet register, retry later*/
if (!bp->phy_dev)
return -EAGAIN;
+#endif
/* RX buffers initialization */
macb_init_rx_buffer_size(bp, bufsz);
@@ -1733,8 +1736,20 @@
bp->macbgem_ops.mog_init_rings(bp);
macb_init_hw(bp);
+#ifdef CONFIG_MACH_OCTONET
+ {
+ u32 reg;
+
+ reg = macb_readl(bp, NCFGR);
+ reg |= MACB_BIT(FD);
+ reg |= MACB_BIT(SPD);
+ macb_writel(bp, NCFGR, reg);
+ }
+ netif_carrier_on(dev);
+#else
/* schedule a link state check */
phy_start(bp->phy_dev);
+#endif
netif_start_queue(dev);
@@ -1936,10 +1951,14 @@
if (!netif_running(dev))
return -EINVAL;
+#ifdef CONFIG_MACH_OCTONET
+ return 0;
+#else
if (!phydev)
return -ENODEV;
return phy_mii_ioctl(phydev, rq, cmd);
+#endif
}
EXPORT_SYMBOL_GPL(macb_ioctl);
@@ -2234,10 +2253,28 @@
macb_is_gem(bp) ? "GEM" : "MACB", dev->base_addr,
dev->irq, dev->dev_addr);
+#ifndef CONFIG_MACH_OCTONET
phydev = bp->phy_dev;
netdev_info(dev, "attached PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)\n",
phydev->drv->name, dev_name(&phydev->dev), phydev->irq);
+#endif
+#ifdef CONFIG_MACH_OCTONET
+ printk("OctoNet fixed to 100Mbit duplex\n");
+ bp->link = 1;
+ bp->speed = SPEED_100;
+ bp->duplex = DUPLEX_FULL;
+ {
+ u32 reg;
+
+ reg = macb_readl(bp, NCFGR);
+ reg |= MACB_BIT(FD);
+ reg |= MACB_BIT(SPD);
+ macb_writel(bp, NCFGR, reg);
+ }
+ macb_writel(bp, USRIO, MACB_BIT(CLKEN));
+ netif_carrier_on(dev);
+#endif
return 0;
err_out_unregister_netdev:
diff -uNr linux-3.17.7/drivers/staging/media/cxd2099/cxd2099.c linux.octonet/drivers/staging/media/cxd2099/cxd2099.c
--- linux-3.17.7/drivers/staging/media/cxd2099/cxd2099.c 2014-12-16 18:37:26.000000000 +0100
+++ linux.octonet/drivers/staging/media/cxd2099/cxd2099.c 1970-01-01 01:00:00.000000000 +0100
@@ -1,719 +0,0 @@
-/*
- * cxd2099.c: Driver for the CXD2099AR Common Interface Controller
- *
- * Copyright (C) 2010-2011 Digital Devices GmbH
- *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 only, as published by the Free Software Foundation.
- *
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA
- * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
- */
-
-#include <linux/slab.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/i2c.h>
-#include <linux/wait.h>
-#include <linux/delay.h>
-#include <linux/mutex.h>
-#include <linux/io.h>
-
-#include "cxd2099.h"
-
-#define MAX_BUFFER_SIZE 248
-
-struct cxd {
- struct dvb_ca_en50221 en;
-
- struct i2c_adapter *i2c;
- struct cxd2099_cfg cfg;
-
- u8 regs[0x23];
- u8 lastaddress;
- u8 clk_reg_f;
- u8 clk_reg_b;
- int mode;
- int ready;
- int dr;
- int slot_stat;
-
- u8 amem[1024];
- int amem_read;
-
- int cammode;
- struct mutex lock;
-};
-
-static int i2c_write_reg(struct i2c_adapter *adapter, u8 adr,
- u8 reg, u8 data)
-{
- u8 m[2] = {reg, data};
- struct i2c_msg msg = {.addr = adr, .flags = 0, .buf = m, .len = 2};
-
- if (i2c_transfer(adapter, &msg, 1) != 1) {
- dev_err(&adapter->dev,
- "Failed to write to I2C register %02x@%02x!\n",
- reg, adr);
- return -1;
- }
- return 0;
-}
-
-static int i2c_write(struct i2c_adapter *adapter, u8 adr,
- u8 *data, u8 len)
-{
- struct i2c_msg msg = {.addr = adr, .flags = 0, .buf = data, .len = len};
-
- if (i2c_transfer(adapter, &msg, 1) != 1) {
- dev_err(&adapter->dev, "Failed to write to I2C!\n");
- return -1;
- }
- return 0;
-}
-
-static int i2c_read_reg(struct i2c_adapter *adapter, u8 adr,
- u8 reg, u8 *val)
-{
- struct i2c_msg msgs[2] = {{.addr = adr, .flags = 0,
- .buf = ®, .len = 1},
- {.addr = adr, .flags = I2C_M_RD,
- .buf = val, .len = 1} };
-
- if (i2c_transfer(adapter, msgs, 2) != 2) {
- dev_err(&adapter->dev, "error in i2c_read_reg\n");
- return -1;
- }
- return 0;
-}
-
-static int i2c_read(struct i2c_adapter *adapter, u8 adr,
- u8 reg, u8 *data, u8 n)
-{
- struct i2c_msg msgs[2] = {{.addr = adr, .flags = 0,
- .buf = ®, .len = 1},
- {.addr = adr, .flags = I2C_M_RD,
- .buf = data, .len = n} };
-
- if (i2c_transfer(adapter, msgs, 2) != 2) {
- dev_err(&adapter->dev, "error in i2c_read\n");
- return -1;
- }
- return 0;
-}
-
-static int read_block(struct cxd *ci, u8 adr, u8 *data, u8 n)
-{
- int status;
-
- status = i2c_write_reg(ci->i2c, ci->cfg.adr, 0, adr);
- if (!status) {
- ci->lastaddress = adr;
- status = i2c_read(ci->i2c, ci->cfg.adr, 1, data, n);
- }
- return status;
-}
-
-static int read_reg(struct cxd *ci, u8 reg, u8 *val)
-{
- return read_block(ci, reg, val, 1);
-}
-
-
-static int read_pccard(struct cxd *ci, u16 address, u8 *data, u8 n)
-{
- int status;
- u8 addr[3] = {2, address & 0xff, address >> 8};
-
- status = i2c_write(ci->i2c, ci->cfg.adr, addr, 3);
- if (!status)
- status = i2c_read(ci->i2c, ci->cfg.adr, 3, data, n);
- return status;
-}
-
-static int write_pccard(struct cxd *ci, u16 address, u8 *data, u8 n)
-{
- int status;
- u8 addr[3] = {2, address & 0xff, address >> 8};
-
- status = i2c_write(ci->i2c, ci->cfg.adr, addr, 3);
- if (!status) {
- u8 buf[256] = {3};
- memcpy(buf+1, data, n);
- status = i2c_write(ci->i2c, ci->cfg.adr, buf, n+1);