db1550.c (f9cd49033b349b8be3bb1f01b39eed837853d880) db1550.c (bd8510df881f63a9e7768824cf0e33c4702dcde1)
1/*
2 * Alchemy Db1550 board support
3 *
4 * (c) 2011 Manuel Lauss <manuel.lauss@googlemail.com>
5 */
6
7#include <linux/dma-mapping.h>
8#include <linux/gpio.h>

--- 12 unchanged lines hidden (view full) ---

21#include <asm/mach-au1x00/au1xxx_eth.h>
22#include <asm/mach-au1x00/au1xxx_dbdma.h>
23#include <asm/mach-au1x00/au1xxx_psc.h>
24#include <asm/mach-au1x00/au1550_spi.h>
25#include <asm/mach-db1x00/bcsr.h>
26#include <prom.h>
27#include "platform.h"
28
1/*
2 * Alchemy Db1550 board support
3 *
4 * (c) 2011 Manuel Lauss <manuel.lauss@googlemail.com>
5 */
6
7#include <linux/dma-mapping.h>
8#include <linux/gpio.h>

--- 12 unchanged lines hidden (view full) ---

21#include <asm/mach-au1x00/au1xxx_eth.h>
22#include <asm/mach-au1x00/au1xxx_dbdma.h>
23#include <asm/mach-au1x00/au1xxx_psc.h>
24#include <asm/mach-au1x00/au1550_spi.h>
25#include <asm/mach-db1x00/bcsr.h>
26#include <prom.h>
27#include "platform.h"
28
29
30const char *get_system_type(void)
31{
32 return "DB1550";
33}
34
35static void __init db1550_hw_setup(void)
36{
37 void __iomem *base;
38
39 alchemy_gpio_direction_output(203, 0); /* red led on */
40
41 /* complete SPI setup: link psc0_intclk to a 48MHz source,
42 * and assign GPIO16 to PSC0_SYNC1 (SPI cs# line)

--- 13 unchanged lines hidden (view full) ---

56 __raw_writel(PSC_CTRL_DISABLE, base + PSC_CTRL_OFFSET);
57 wmb();
58 __raw_writel(PSC_AC97RST_RST, base + PSC_AC97RST_OFFSET);
59 wmb();
60
61 alchemy_gpio_direction_output(202, 0); /* green led on */
62}
63
29static void __init db1550_hw_setup(void)
30{
31 void __iomem *base;
32
33 alchemy_gpio_direction_output(203, 0); /* red led on */
34
35 /* complete SPI setup: link psc0_intclk to a 48MHz source,
36 * and assign GPIO16 to PSC0_SYNC1 (SPI cs# line)

--- 13 unchanged lines hidden (view full) ---

50 __raw_writel(PSC_CTRL_DISABLE, base + PSC_CTRL_OFFSET);
51 wmb();
52 __raw_writel(PSC_AC97RST_RST, base + PSC_AC97RST_OFFSET);
53 wmb();
54
55 alchemy_gpio_direction_output(202, 0); /* green led on */
56}
57
64void __init board_setup(void)
58int __init db1550_board_setup(void)
65{
66 unsigned short whoami;
67
68 bcsr_init(DB1550_BCSR_PHYS_ADDR,
69 DB1550_BCSR_PHYS_ADDR + DB1550_BCSR_HEXLED_OFS);
70
71 whoami = bcsr_read(BCSR_WHOAMI);
72 printk(KERN_INFO "Alchemy/AMD DB1550 Board, CPLD Rev %d"
73 " Board-ID %d Daughtercard ID %d\n",
74 (whoami >> 4) & 0xf, (whoami >> 8) & 0xf, whoami & 0xf);
75
76 db1550_hw_setup();
59{
60 unsigned short whoami;
61
62 bcsr_init(DB1550_BCSR_PHYS_ADDR,
63 DB1550_BCSR_PHYS_ADDR + DB1550_BCSR_HEXLED_OFS);
64
65 whoami = bcsr_read(BCSR_WHOAMI);
66 printk(KERN_INFO "Alchemy/AMD DB1550 Board, CPLD Rev %d"
67 " Board-ID %d Daughtercard ID %d\n",
68 (whoami >> 4) & 0xf, (whoami >> 8) & 0xf, whoami & 0xf);
69
70 db1550_hw_setup();
71 return 0;
77}
78
79/*****************************************************************************/
80
81static struct mtd_partition db1550_spiflash_parts[] = {
82 {
83 .name = "spi_flash",
84 .offset = 0,

--- 340 unchanged lines hidden (view full) ---

425 &db1550_stac_dev,
426 &db1550_ac97dma_dev,
427 &db1550_i2sdma_dev,
428 &db1550_sndac97_dev,
429 &db1550_sndi2s_dev,
430};
431
432/* must be arch_initcall; MIPS PCI scans busses in a subsys_initcall */
72}
73
74/*****************************************************************************/
75
76static struct mtd_partition db1550_spiflash_parts[] = {
77 {
78 .name = "spi_flash",
79 .offset = 0,

--- 340 unchanged lines hidden (view full) ---

420 &db1550_stac_dev,
421 &db1550_ac97dma_dev,
422 &db1550_i2sdma_dev,
423 &db1550_sndac97_dev,
424 &db1550_sndi2s_dev,
425};
426
427/* must be arch_initcall; MIPS PCI scans busses in a subsys_initcall */
433static int __init db1550_pci_init(void)
428int __init db1550_pci_setup(void)
434{
435 return platform_device_register(&db1550_pci_host_dev);
436}
429{
430 return platform_device_register(&db1550_pci_host_dev);
431}
437arch_initcall(db1550_pci_init);
438
432
439static int __init db1550_dev_init(void)
433int __init db1550_dev_setup(void)
440{
441 int swapped;
442
443 irq_set_irq_type(AU1550_GPIO0_INT, IRQ_TYPE_EDGE_BOTH); /* CD0# */
444 irq_set_irq_type(AU1550_GPIO1_INT, IRQ_TYPE_EDGE_BOTH); /* CD1# */
445 irq_set_irq_type(AU1550_GPIO3_INT, IRQ_TYPE_LEVEL_LOW); /* CARD0# */
446 irq_set_irq_type(AU1550_GPIO5_INT, IRQ_TYPE_LEVEL_LOW); /* CARD1# */
447 irq_set_irq_type(AU1550_GPIO21_INT, IRQ_TYPE_LEVEL_LOW); /* STSCHG0# */

--- 39 unchanged lines hidden (view full) ---

487 AU1550_GPIO5_INT, AU1550_GPIO1_INT,
488 /*AU1550_GPIO22_INT*/0, 0, 1);
489
490 swapped = bcsr_read(BCSR_STATUS) & BCSR_STATUS_DB1000_SWAPBOOT;
491 db1x_register_norflash(128 << 20, 4, swapped);
492
493 return platform_add_devices(db1550_devs, ARRAY_SIZE(db1550_devs));
494}
434{
435 int swapped;
436
437 irq_set_irq_type(AU1550_GPIO0_INT, IRQ_TYPE_EDGE_BOTH); /* CD0# */
438 irq_set_irq_type(AU1550_GPIO1_INT, IRQ_TYPE_EDGE_BOTH); /* CD1# */
439 irq_set_irq_type(AU1550_GPIO3_INT, IRQ_TYPE_LEVEL_LOW); /* CARD0# */
440 irq_set_irq_type(AU1550_GPIO5_INT, IRQ_TYPE_LEVEL_LOW); /* CARD1# */
441 irq_set_irq_type(AU1550_GPIO21_INT, IRQ_TYPE_LEVEL_LOW); /* STSCHG0# */

--- 39 unchanged lines hidden (view full) ---

481 AU1550_GPIO5_INT, AU1550_GPIO1_INT,
482 /*AU1550_GPIO22_INT*/0, 0, 1);
483
484 swapped = bcsr_read(BCSR_STATUS) & BCSR_STATUS_DB1000_SWAPBOOT;
485 db1x_register_norflash(128 << 20, 4, swapped);
486
487 return platform_add_devices(db1550_devs, ARRAY_SIZE(db1550_devs));
488}
495device_initcall(db1550_dev_init);