Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

blackfin: add bf60x to current framework

This patch added bf60x to current blackfin kernel framework.

Signed-off-by: Bob Liu <lliubbo@gmail.com>

Bob Liu b5affb01 22a82628

+841 -147
+20 -5
arch/blackfin/Kconfig
··· 226 226 help 227 227 BF561 Processor Support. 228 228 229 + config BF609 230 + bool "BF609" 231 + select CLKDEV_LOOKUP 232 + help 233 + BF609 Processor Support. 234 + 229 235 endchoice 230 236 231 237 config SMP ··· 257 251 258 252 config BF_REV_MIN 259 253 int 260 - default 0 if (BF51x || BF52x || (BF54x && !BF54xM)) 254 + default 0 if (BF51x || BF52x || (BF54x && !BF54xM)) || BF60x 261 255 default 2 if (BF537 || BF536 || BF534) 262 256 default 3 if (BF561 || BF533 || BF532 || BF531 || BF54xM) 263 257 default 4 if (BF538 || BF539) 264 258 265 259 config BF_REV_MAX 266 260 int 267 - default 2 if (BF51x || BF52x || (BF54x && !BF54xM)) 261 + default 2 if (BF51x || BF52x || (BF54x && !BF54xM)) || BF60x 268 262 default 3 if (BF537 || BF536 || BF534 || BF54xM) 269 263 default 5 if (BF561 || BF538 || BF539) 270 264 default 6 if (BF533 || BF532 || BF531) 271 265 272 266 choice 273 267 prompt "Silicon Rev" 274 - default BF_REV_0_0 if (BF51x || BF52x) 268 + default BF_REV_0_0 if (BF51x || BF52x || BF60x) 275 269 default BF_REV_0_2 if (BF534 || BF536 || BF537 || (BF54x && !BF54xM)) 276 270 default BF_REV_0_3 if (BF531 || BF532 || BF533 || BF54xM || BF561) 277 271 278 272 config BF_REV_0_0 279 273 bool "0.0" 280 - depends on (BF51x || BF52x || (BF54x && !BF54xM)) 274 + depends on (BF51x || BF52x || (BF54x && !BF54xM) || BF60x) 281 275 282 276 config BF_REV_0_1 283 277 bool "0.1" ··· 356 350 source "arch/blackfin/mach-bf537/Kconfig" 357 351 source "arch/blackfin/mach-bf538/Kconfig" 358 352 source "arch/blackfin/mach-bf548/Kconfig" 353 + source "arch/blackfin/mach-bf609/Kconfig" 359 354 360 355 menu "Board customizations" 361 356 ··· 385 378 Note that you need to keep this value above 4k (0x1000) as this 386 379 memory region is used to capture NULL pointer references as well 387 380 as some core kernel functions. 381 + 382 + config PHY_RAM_BASE_ADDRESS 383 + hex "Physical RAM Base" 384 + default 0x0 385 + help 386 + set BF609 FPGA physical SRAM base address 388 387 389 388 config ROM_BASE 390 389 hex "Kernel ROM Base" ··· 1064 1051 config BFIN_L2_DCACHEABLE 1065 1052 bool "Enable DCACHE for L2 SRAM" 1066 1053 depends on BFIN_DCACHE 1067 - depends on (BF54x || BF561) && !SMP 1054 + depends on (BF54x || BF561 || BF60x) && !SMP 1068 1055 default n 1069 1056 choice 1070 1057 prompt "L2 SRAM DCACHE policy" ··· 1090 1077 comment "Asynchronous Memory Configuration" 1091 1078 1092 1079 menu "EBIU_AMGCTL Global Control" 1080 + depends on !BF60x 1093 1081 config C_AMCKEN 1094 1082 bool "Enable CLKOUT" 1095 1083 default y ··· 1141 1127 endmenu 1142 1128 1143 1129 menu "EBIU_AMBCTL Control" 1130 + depends on !BF60x 1144 1131 config BANK_0 1145 1132 hex "Bank 0 (AMBCTL0.L)" 1146 1133 default 0x7BB0
+2
arch/blackfin/Makefile
··· 54 54 machine-$(CONFIG_BF549) := bf548 55 55 machine-$(CONFIG_BF549M) := bf548 56 56 machine-$(CONFIG_BF561) := bf561 57 + machine-$(CONFIG_BF609) := bf609 57 58 MACHINE := $(machine-y) 58 59 export MACHINE 59 60 ··· 87 86 cpu-$(CONFIG_BF549) := bf549 88 87 cpu-$(CONFIG_BF549M) := bf549m 89 88 cpu-$(CONFIG_BF561) := bf561 89 + cpu-$(CONFIG_BF609) := bf609 90 90 91 91 rev-$(CONFIG_BF_REV_0_0) := 0.0 92 92 rev-$(CONFIG_BF_REV_0_1) := 0.1
+153
arch/blackfin/configs/BF609-EZKIT_defconfig
··· 1 + CONFIG_EXPERIMENTAL=y 2 + CONFIG_SYSVIPC=y 3 + CONFIG_IKCONFIG=y 4 + CONFIG_IKCONFIG_PROC=y 5 + CONFIG_LOG_BUF_SHIFT=14 6 + CONFIG_BLK_DEV_INITRD=y 7 + CONFIG_EXPERT=y 8 + # CONFIG_ELF_CORE is not set 9 + # CONFIG_FUTEX is not set 10 + # CONFIG_SIGNALFD is not set 11 + # CONFIG_TIMERFD is not set 12 + # CONFIG_EVENTFD is not set 13 + # CONFIG_AIO is not set 14 + CONFIG_SLAB=y 15 + CONFIG_MMAP_ALLOW_UNINITIALIZED=y 16 + CONFIG_MODULES=y 17 + CONFIG_MODULE_UNLOAD=y 18 + # CONFIG_LBDAF is not set 19 + # CONFIG_BLK_DEV_BSG is not set 20 + # CONFIG_IOSCHED_DEADLINE is not set 21 + # CONFIG_IOSCHED_CFQ is not set 22 + CONFIG_PREEMPT_VOLUNTARY=y 23 + CONFIG_BF609=y 24 + CONFIG_PINT1_ASSIGN=0x01010000 25 + CONFIG_PINT2_ASSIGN=0x07000101 26 + CONFIG_PINT3_ASSIGN=0x02020303 27 + CONFIG_HIGH_RES_TIMERS=y 28 + CONFIG_IP_CHECKSUM_L1=y 29 + CONFIG_SYSCALL_TAB_L1=y 30 + CONFIG_CPLB_SWITCH_TAB_L1=y 31 + # CONFIG_APP_STACK_L1 is not set 32 + # CONFIG_BFIN_INS_LOWOVERHEAD is not set 33 + CONFIG_NOMMU_INITIAL_TRIM_EXCESS=0 34 + CONFIG_BINFMT_FLAT=y 35 + CONFIG_BINFMT_ZFLAT=y 36 + # CONFIG_SUSPEND is not set 37 + CONFIG_CPU_FREQ=y 38 + CONFIG_CPU_FREQ_GOV_POWERSAVE=y 39 + CONFIG_CPU_FREQ_GOV_ONDEMAND=y 40 + CONFIG_NET=y 41 + CONFIG_PACKET=y 42 + CONFIG_UNIX=y 43 + CONFIG_INET=y 44 + CONFIG_IP_PNP=y 45 + CONFIG_IP_PNP_DHCP=y 46 + CONFIG_IP_PNP_BOOTP=y 47 + CONFIG_IP_PNP_RARP=y 48 + # CONFIG_IPV6 is not set 49 + CONFIG_NETFILTER=y 50 + CONFIG_CAN=y 51 + CONFIG_CAN_BFIN=y 52 + CONFIG_IRDA=y 53 + CONFIG_IRTTY_SIR=y 54 + # CONFIG_WIRELESS is not set 55 + CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 56 + CONFIG_FW_LOADER=m 57 + CONFIG_MTD=y 58 + CONFIG_MTD_CMDLINE_PARTS=y 59 + CONFIG_MTD_CHAR=y 60 + CONFIG_MTD_CFI=y 61 + CONFIG_MTD_CFI_INTELEXT=y 62 + CONFIG_MTD_CFI_STAA=y 63 + CONFIG_MTD_COMPLEX_MAPPINGS=y 64 + CONFIG_MTD_BFIN_BF60x=y 65 + CONFIG_MTD_M25P80=y 66 + CONFIG_MTD_UBI=m 67 + CONFIG_SCSI=y 68 + CONFIG_BLK_DEV_SD=y 69 + CONFIG_NETDEVICES=y 70 + # CONFIG_NET_VENDOR_BROADCOM is not set 71 + # CONFIG_NET_VENDOR_CHELSIO is not set 72 + # CONFIG_NET_VENDOR_INTEL is not set 73 + # CONFIG_NET_VENDOR_MARVELL is not set 74 + # CONFIG_NET_VENDOR_MICREL is not set 75 + # CONFIG_NET_VENDOR_MICROCHIP is not set 76 + # CONFIG_NET_VENDOR_NATSEMI is not set 77 + # CONFIG_NET_VENDOR_SEEQ is not set 78 + # CONFIG_NET_VENDOR_SMSC is not set 79 + CONFIG_STMMAC_ETH=y 80 + CONFIG_STMMAC_IEEE1588=y 81 + # CONFIG_WLAN is not set 82 + # CONFIG_INPUT_MOUSEDEV is not set 83 + CONFIG_INPUT_EVDEV=y 84 + # CONFIG_INPUT_KEYBOARD is not set 85 + # CONFIG_INPUT_MOUSE is not set 86 + CONFIG_INPUT_MISC=y 87 + CONFIG_INPUT_BFIN_ROTARY=y 88 + # CONFIG_SERIO is not set 89 + # CONFIG_LEGACY_PTYS is not set 90 + CONFIG_BFIN_SIMPLE_TIMER=m 91 + CONFIG_BFIN_LINKPORT=y 92 + # CONFIG_DEVKMEM is not set 93 + CONFIG_SERIAL_BFIN=y 94 + CONFIG_SERIAL_BFIN_CONSOLE=y 95 + CONFIG_SERIAL_BFIN_UART0=y 96 + # CONFIG_HW_RANDOM is not set 97 + CONFIG_I2C=y 98 + CONFIG_I2C_CHARDEV=y 99 + CONFIG_I2C_BLACKFIN_TWI=y 100 + CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=100 101 + CONFIG_SPI=y 102 + CONFIG_SPI_BFIN6XX=y 103 + CONFIG_GPIOLIB=y 104 + CONFIG_GPIO_SYSFS=y 105 + # CONFIG_HWMON is not set 106 + CONFIG_WATCHDOG=y 107 + CONFIG_BFIN_WDT=y 108 + CONFIG_SOUND=m 109 + CONFIG_SND=m 110 + CONFIG_SND_MIXER_OSS=m 111 + CONFIG_SND_PCM_OSS=m 112 + # CONFIG_SND_DRIVERS is not set 113 + # CONFIG_SND_SPI is not set 114 + # CONFIG_SND_USB is not set 115 + CONFIG_SND_SOC=m 116 + CONFIG_SND_BF6XX_I2S=m 117 + CONFIG_SND_SOC_BFIN_EVAL_ADAU1X61=m 118 + CONFIG_SND_SOC_ALL_CODECS=m 119 + CONFIG_USB=y 120 + CONFIG_USB_MUSB_HDRC=y 121 + CONFIG_USB_MUSB_BLACKFIN=y 122 + CONFIG_USB_STORAGE=y 123 + CONFIG_USB_GADGET=y 124 + CONFIG_USB_GADGET_MUSB_HDRC=y 125 + CONFIG_USB_ZERO=y 126 + CONFIG_MMC=y 127 + CONFIG_SDH_BFIN=y 128 + # CONFIG_IOMMU_SUPPORT is not set 129 + CONFIG_EXT2_FS=y 130 + # CONFIG_DNOTIFY is not set 131 + CONFIG_MSDOS_FS=y 132 + CONFIG_VFAT_FS=y 133 + CONFIG_JFFS2_FS=m 134 + CONFIG_UBIFS_FS=m 135 + CONFIG_NFS_FS=m 136 + CONFIG_NFS_V3=y 137 + CONFIG_NLS_CODEPAGE_437=y 138 + CONFIG_NLS_ISO8859_1=y 139 + CONFIG_DEBUG_FS=y 140 + CONFIG_DEBUG_SHIRQ=y 141 + CONFIG_DETECT_HUNG_TASK=y 142 + CONFIG_DEBUG_INFO=y 143 + CONFIG_FRAME_POINTER=y 144 + # CONFIG_FTRACE is not set 145 + CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE=y 146 + CONFIG_EARLY_PRINTK=y 147 + CONFIG_CPLB_INFO=y 148 + CONFIG_BFIN_PSEUDODBG_INSNS=y 149 + CONFIG_CRYPTO_HMAC=y 150 + CONFIG_CRYPTO_MD4=y 151 + CONFIG_CRYPTO_MD5=y 152 + CONFIG_CRYPTO_ARC4=y 153 + # CONFIG_CRYPTO_ANSI_CPRNG is not set
+5
arch/blackfin/include/asm/bfin-global.h
··· 35 35 36 36 extern unsigned long get_cclk(void); 37 37 extern unsigned long get_sclk(void); 38 + #ifdef CONFIG_BF60x 39 + extern unsigned long get_sclk0(void); 40 + extern unsigned long get_sclk1(void); 41 + extern unsigned long get_dramclk(void); 42 + #endif 38 43 extern unsigned long sclk_to_usecs(unsigned long sclk); 39 44 extern unsigned long usecs_to_sclk(unsigned long usecs); 40 45
+79 -5
arch/blackfin/include/asm/bfin_dma.h
··· 15 15 #define DMAEN 0x0001 /* DMA Channel Enable */ 16 16 #define WNR 0x0002 /* Channel Direction (W/R*) */ 17 17 #define WDSIZE_8 0x0000 /* Transfer Word Size = 8 */ 18 + #define PSIZE_8 0x00000000 /* Transfer Word Size = 16 */ 19 + 20 + #ifdef CONFIG_BF60x 21 + 22 + #define PSIZE_16 0x00000010 /* Transfer Word Size = 16 */ 23 + #define PSIZE_32 0x00000020 /* Transfer Word Size = 32 */ 24 + #define PSIZE_64 0x00000030 /* Transfer Word Size = 32 */ 25 + #define WDSIZE_16 0x00000100 /* Transfer Word Size = 16 */ 26 + #define WDSIZE_32 0x00000200 /* Transfer Word Size = 32 */ 27 + #define WDSIZE_64 0x00000300 /* Transfer Word Size = 32 */ 28 + #define WDSIZE_128 0x00000400 /* Transfer Word Size = 32 */ 29 + #define WDSIZE_256 0x00000500 /* Transfer Word Size = 32 */ 30 + #define DMA2D 0x04000000 /* DMA Mode (2D/1D*) */ 31 + #define RESTART 0x00000004 /* DMA Buffer Clear SYNC */ 32 + #define DI_EN_X 0x00100000 /* Data Interrupt Enable in X count */ 33 + #define DI_EN_Y 0x00200000 /* Data Interrupt Enable in Y count */ 34 + #define DI_EN_P 0x00300000 /* Data Interrupt Enable in Peripheral */ 35 + #define DI_EN DI_EN_X /* Data Interrupt Enable */ 36 + #define NDSIZE_0 0x00000000 /* Next Descriptor Size = 1 */ 37 + #define NDSIZE_1 0x00010000 /* Next Descriptor Size = 2 */ 38 + #define NDSIZE_2 0x00020000 /* Next Descriptor Size = 3 */ 39 + #define NDSIZE_3 0x00030000 /* Next Descriptor Size = 4 */ 40 + #define NDSIZE_4 0x00040000 /* Next Descriptor Size = 5 */ 41 + #define NDSIZE_5 0x00050000 /* Next Descriptor Size = 6 */ 42 + #define NDSIZE_6 0x00060000 /* Next Descriptor Size = 7 */ 43 + #define NDSIZE 0x00070000 /* Next Descriptor Size */ 44 + #define NDSIZE_OFFSET 16 /* Next Descriptor Size Offset */ 45 + #define DMAFLOW_LIST 0x00004000 /* Descriptor List Mode */ 46 + #define DMAFLOW_LARGE DMAFLOW_LIST 47 + #define DMAFLOW_ARRAY 0x00005000 /* Descriptor Array Mode */ 48 + #define DMAFLOW_LIST_DEMAND 0x00006000 /* Descriptor Demand List Mode */ 49 + #define DMAFLOW_ARRAY_DEMAND 0x00007000 /* Descriptor Demand Array Mode */ 50 + #define DMA_RUN_DFETCH 0x00000100 /* DMA Channel Running Indicator (DFETCH) */ 51 + #define DMA_RUN 0x00000200 /* DMA Channel Running Indicator */ 52 + #define DMA_RUN_WAIT_TRIG 0x00000300 /* DMA Channel Running Indicator (WAIT TRIG) */ 53 + #define DMA_RUN_WAIT_ACK 0x00000400 /* DMA Channel Running Indicator (WAIT ACK) */ 54 + 55 + #else 56 + 57 + #define PSIZE_16 0x0000 /* Transfer Word Size = 16 */ 58 + #define PSIZE_32 0x0000 /* Transfer Word Size = 32 */ 18 59 #define WDSIZE_16 0x0004 /* Transfer Word Size = 16 */ 19 60 #define WDSIZE_32 0x0008 /* Transfer Word Size = 32 */ 20 61 #define DMA2D 0x0010 /* DMA Mode (2D/1D*) */ 21 62 #define RESTART 0x0020 /* DMA Buffer Clear */ 22 63 #define DI_SEL 0x0040 /* Data Interrupt Timing Select */ 23 64 #define DI_EN 0x0080 /* Data Interrupt Enable */ 65 + #define DI_EN_X 0x00C0 /* Data Interrupt Enable in X count*/ 66 + #define DI_EN_Y 0x0080 /* Data Interrupt Enable in Y count*/ 24 67 #define NDSIZE_0 0x0000 /* Next Descriptor Size = 0 (Stop/Autobuffer) */ 25 68 #define NDSIZE_1 0x0100 /* Next Descriptor Size = 1 */ 26 69 #define NDSIZE_2 0x0200 /* Next Descriptor Size = 2 */ ··· 75 32 #define NDSIZE_8 0x0800 /* Next Descriptor Size = 8 */ 76 33 #define NDSIZE_9 0x0900 /* Next Descriptor Size = 9 */ 77 34 #define NDSIZE 0x0f00 /* Next Descriptor Size */ 78 - #define DMAFLOW 0x7000 /* Flow Control */ 79 - #define DMAFLOW_STOP 0x0000 /* Stop Mode */ 80 - #define DMAFLOW_AUTO 0x1000 /* Autobuffer Mode */ 35 + #define NDSIZE_OFFSET 8 /* Next Descriptor Size Offset */ 81 36 #define DMAFLOW_ARRAY 0x4000 /* Descriptor Array Mode */ 82 37 #define DMAFLOW_SMALL 0x6000 /* Small Model Descriptor List Mode */ 83 38 #define DMAFLOW_LARGE 0x7000 /* Large Model Descriptor List Mode */ 39 + #define DFETCH 0x0004 /* DMA Descriptor Fetch Indicator */ 40 + #define DMA_RUN 0x0008 /* DMA Channel Running Indicator */ 41 + 42 + #endif 43 + #define DMAFLOW 0x7000 /* Flow Control */ 44 + #define DMAFLOW_STOP 0x0000 /* Stop Mode */ 45 + #define DMAFLOW_AUTO 0x1000 /* Autobuffer Mode */ 84 46 85 47 /* DMA_IRQ_STATUS Masks */ 86 48 #define DMA_DONE 0x0001 /* DMA Completion Interrupt Status */ 87 49 #define DMA_ERR 0x0002 /* DMA Error Interrupt Status */ 88 - #define DFETCH 0x0004 /* DMA Descriptor Fetch Indicator */ 89 - #define DMA_RUN 0x0008 /* DMA Channel Running Indicator */ 50 + #ifdef CONFIG_BF60x 51 + #define DMA_PIRQ 0x0004 /* DMA Peripheral Error Interrupt Status */ 52 + #else 53 + #define DMA_PIRQ 0 54 + #endif 90 55 91 56 /* 92 57 * All Blackfin system MMRs are padded to 32bits even if the register ··· 108 57 struct bfin_dma_regs { 109 58 u32 next_desc_ptr; 110 59 u32 start_addr; 60 + #ifdef CONFIG_BF60x 61 + u32 cfg; 62 + u32 x_count; 63 + u32 x_modify; 64 + u32 y_count; 65 + u32 y_modify; 66 + u32 pad1; 67 + u32 pad2; 68 + u32 curr_desc_ptr; 69 + u32 prev_desc_ptr; 70 + u32 curr_addr; 71 + u32 irq_status; 72 + u32 curr_x_count; 73 + u32 curr_y_count; 74 + u32 pad3; 75 + u32 bw_limit_count; 76 + u32 curr_bw_limit_count; 77 + u32 bw_monitor_count; 78 + u32 curr_bw_monitor_count; 79 + #else 111 80 __BFP(config); 112 81 u32 __pad0; 113 82 __BFP(x_count); ··· 142 71 u32 __pad1; 143 72 __BFP(curr_y_count); 144 73 u32 __pad2; 74 + #endif 145 75 }; 146 76 77 + #ifndef CONFIG_BF60x 147 78 /* 148 79 * bfin handshake mdma registers layout 149 80 */ ··· 158 85 __BFP(ecount); 159 86 __BFP(bcount); 160 87 }; 88 + #endif 161 89 162 90 #undef __BFP 163 91
+154 -14
arch/blackfin/include/asm/bfin_serial.h
··· 18 18 defined(CONFIG_BFIN_UART1_CTSRTS) || \ 19 19 defined(CONFIG_BFIN_UART2_CTSRTS) || \ 20 20 defined(CONFIG_BFIN_UART3_CTSRTS) 21 - # ifdef BFIN_UART_BF54X_STYLE 21 + # if defined(BFIN_UART_BF54X_STYLE) || defined(BFIN_UART_BF60X_STYLE) 22 22 # define CONFIG_SERIAL_BFIN_HARD_CTSRTS 23 23 # else 24 24 # define CONFIG_SERIAL_BFIN_CTSRTS ··· 58 58 #endif 59 59 }; 60 60 61 + #ifdef BFIN_UART_BF60X_STYLE 62 + 63 + /* UART_CTL Masks */ 64 + #define UCEN 0x1 /* Enable UARTx Clocks */ 65 + #define LOOP_ENA 0x2 /* Loopback Mode Enable */ 66 + #define UMOD_MDB 0x10 /* Enable MDB Mode */ 67 + #define UMOD_IRDA 0x20 /* Enable IrDA Mode */ 68 + #define UMOD_MASK 0x30 /* Uart Mode Mask */ 69 + #define WLS(x) (((x-5) & 0x03) << 8) /* Word Length Select */ 70 + #define WLS_MASK 0x300 /* Word length Select Mask */ 71 + #define STB 0x1000 /* Stop Bits */ 72 + #define STBH 0x2000 /* Half Stop Bits */ 73 + #define PEN 0x4000 /* Parity Enable */ 74 + #define EPS 0x8000 /* Even Parity Select */ 75 + #define STP 0x10000 /* Stick Parity */ 76 + #define FPE 0x20000 /* Force Parity Error On Transmit */ 77 + #define FFE 0x40000 /* Force Framing Error On Transmit */ 78 + #define SB 0x80000 /* Set Break */ 79 + #define LCR_MASK (STP | EPS | PEN | STB | WLS_MASK) 80 + #define FCPOL 0x400000 /* Flow Control Pin Polarity */ 81 + #define RPOLC 0x800000 /* IrDA RX Polarity Change */ 82 + #define TPOLC 0x1000000 /* IrDA TX Polarity Change */ 83 + #define MRTS 0x2000000 /* Manual Request To Send */ 84 + #define XOFF 0x4000000 /* Transmitter Off */ 85 + #define ARTS 0x8000000 /* Automatic Request To Send */ 86 + #define ACTS 0x10000000 /* Automatic Clear To Send */ 87 + #define RFIT 0x20000000 /* Receive FIFO IRQ Threshold */ 88 + #define RFRT 0x40000000 /* Receive FIFO RTS Threshold */ 89 + 90 + /* UART_STAT Masks */ 91 + #define DR 0x01 /* Data Ready */ 92 + #define OE 0x02 /* Overrun Error */ 93 + #define PE 0x04 /* Parity Error */ 94 + #define FE 0x08 /* Framing Error */ 95 + #define BI 0x10 /* Break Interrupt */ 96 + #define THRE 0x20 /* THR Empty */ 97 + #define TEMT 0x80 /* TSR and UART_THR Empty */ 98 + #define TFI 0x100 /* Transmission Finished Indicator */ 99 + 100 + #define ASTKY 0x200 /* Address Sticky */ 101 + #define ADDR 0x400 /* Address bit status */ 102 + #define RO 0x800 /* Reception Ongoing */ 103 + #define SCTS 0x1000 /* Sticky CTS */ 104 + #define CTS 0x10000 /* Clear To Send */ 105 + #define RFCS 0x20000 /* Receive FIFO Count Status */ 106 + 107 + /* UART_CLOCK Masks */ 108 + #define EDBO 0x80000000 /* Enable Devide by One */ 109 + 110 + #else /* BFIN_UART_BF60X_STYLE */ 111 + 61 112 /* UART_LCR Masks */ 62 113 #define WLS(x) (((x)-5) & 0x03) /* Word Length Select */ 114 + #define WLS_MASK 0x03 /* Word length Select Mask */ 63 115 #define STB 0x04 /* Stop Bits */ 64 116 #define PEN 0x08 /* Parity Enable */ 65 117 #define EPS 0x10 /* Even Parity Select */ 66 118 #define STP 0x20 /* Stick Parity */ 67 119 #define SB 0x40 /* Set Break */ 68 120 #define DLAB 0x80 /* Divisor Latch Access */ 121 + #define LCR_MASK (STP | EPS | PEN | STB | WLS_MASK) 69 122 70 123 /* UART_LSR Masks */ 71 124 #define DR 0x01 /* Data Ready */ ··· 129 76 #define THRE 0x20 /* THR Empty */ 130 77 #define TEMT 0x40 /* TSR and UART_THR Empty */ 131 78 #define TFI 0x80 /* Transmission Finished Indicator */ 132 - 133 - /* UART_IER Masks */ 134 - #define ERBFI 0x01 /* Enable Receive Buffer Full Interrupt */ 135 - #define ETBEI 0x02 /* Enable Transmit Buffer Empty Interrupt */ 136 - #define ELSI 0x04 /* Enable RX Status Interrupt */ 137 - #define EDSSI 0x08 /* Enable Modem Status Interrupt */ 138 - #define EDTPTI 0x10 /* Enable DMA Transmit PIRQ Interrupt */ 139 - #define ETFI 0x20 /* Enable Transmission Finished Interrupt */ 140 - #define ERFCI 0x40 /* Enable Receive FIFO Count Interrupt */ 141 79 142 80 /* UART_MCR Masks */ 143 81 #define XOFF 0x01 /* Transmitter Off */ ··· 147 103 148 104 /* UART_GCTL Masks */ 149 105 #define UCEN 0x01 /* Enable UARTx Clocks */ 150 - #define IREN 0x02 /* Enable IrDA Mode */ 106 + #define UMOD_IRDA 0x02 /* Enable IrDA Mode */ 107 + #define UMOD_MASK 0x02 /* Uart Mode Mask */ 151 108 #define TPOLC 0x04 /* IrDA TX Polarity Change */ 152 109 #define RPOLC 0x08 /* IrDA RX Polarity Change */ 153 110 #define FPE 0x10 /* Force Parity Error On Transmit */ 154 111 #define FFE 0x20 /* Force Framing Error On Transmit */ 155 112 156 - #ifdef BFIN_UART_BF54X_STYLE 113 + #endif /* BFIN_UART_BF60X_STYLE */ 114 + 115 + /* UART_IER Masks */ 116 + #define ERBFI 0x01 /* Enable Receive Buffer Full Interrupt */ 117 + #define ETBEI 0x02 /* Enable Transmit Buffer Empty Interrupt */ 118 + #define ELSI 0x04 /* Enable RX Status Interrupt */ 119 + #define EDSSI 0x08 /* Enable Modem Status Interrupt */ 120 + #define EDTPTI 0x10 /* Enable DMA Transmit PIRQ Interrupt */ 121 + #define ETFI 0x20 /* Enable Transmission Finished Interrupt */ 122 + #define ERFCI 0x40 /* Enable Receive FIFO Count Interrupt */ 123 + 124 + #if defined(BFIN_UART_BF60X_STYLE) 125 + # define OFFSET_REDIV 0x00 /* Version ID Register */ 126 + # define OFFSET_CTL 0x04 /* Control Register */ 127 + # define OFFSET_STAT 0x08 /* Status Register */ 128 + # define OFFSET_SCR 0x0C /* SCR Scratch Register */ 129 + # define OFFSET_CLK 0x10 /* Clock Rate Register */ 130 + # define OFFSET_IER 0x14 /* Interrupt Enable Register */ 131 + # define OFFSET_IER_SET 0x18 /* Set Interrupt Enable Register */ 132 + # define OFFSET_IER_CLEAR 0x1C /* Clear Interrupt Enable Register */ 133 + # define OFFSET_RBR 0x20 /* Receive Buffer register */ 134 + # define OFFSET_THR 0x24 /* Transmit Holding register */ 135 + #elif defined(BFIN_UART_BF54X_STYLE) 157 136 # define OFFSET_DLL 0x00 /* Divisor Latch (Low-Byte) */ 158 137 # define OFFSET_DLH 0x04 /* Divisor Latch (High-Byte) */ 159 138 # define OFFSET_GCTL 0x08 /* Global Control Register */ ··· 212 145 */ 213 146 #define __BFP(m) u16 m; u16 __pad_##m 214 147 struct bfin_uart_regs { 215 - #ifdef BFIN_UART_BF54X_STYLE 148 + #if defined(BFIN_UART_BF60X_STYLE) 149 + u32 revid; 150 + u32 ctl; 151 + u32 stat; 152 + u32 scr; 153 + u32 clk; 154 + u32 ier; 155 + u32 ier_set; 156 + u32 ier_clear; 157 + u32 rbr; 158 + u32 thr; 159 + u32 taip; 160 + u32 tsr; 161 + u32 rsr; 162 + u32 txdiv; 163 + u32 rxdiv; 164 + #elif defined(BFIN_UART_BF54X_STYLE) 216 165 __BFP(dll); 217 166 __BFP(dlh); 218 167 __BFP(gctl); ··· 265 182 }; 266 183 #undef __BFP 267 184 185 + #define port_membase(uart) (((struct bfin_serial_port *)(uart))->port.membase) 186 + 187 + /* 268 188 #ifndef port_membase 269 189 # define port_membase(p) 0 270 190 #endif 191 + */ 192 + #ifdef BFIN_UART_BF60X_STYLE 193 + 194 + #define UART_GET_CHAR(p) bfin_read32(port_membase(p) + OFFSET_RBR) 195 + #define UART_GET_CLK(p) bfin_read32(port_membase(p) + OFFSET_CLK) 196 + #define UART_GET_CTL(p) bfin_read32(port_membase(p) + OFFSET_CTL) 197 + #define UART_GET_GCTL(p) UART_GET_CTL(p) 198 + #define UART_GET_LCR(p) UART_GET_CTL(p) 199 + #define UART_GET_MCR(p) UART_GET_CTL(p) 200 + #define UART_GET_STAT(p) bfin_read32(port_membase(p) + OFFSET_STAT) 201 + #define UART_GET_MSR(p) UART_GET_STAT(p) 202 + 203 + #define UART_PUT_CHAR(p, v) bfin_write32(port_membase(p) + OFFSET_THR, v) 204 + #define UART_PUT_CLK(p, v) bfin_write32(port_membase(p) + OFFSET_CLK, v) 205 + #define UART_PUT_CTL(p, v) bfin_write32(port_membase(p) + OFFSET_CTL, v) 206 + #define UART_PUT_GCTL(p, v) UART_PUT_CTL(p, v) 207 + #define UART_PUT_LCR(p, v) UART_PUT_CTL(p, v) 208 + #define UART_PUT_MCR(p, v) UART_PUT_CTL(p, v) 209 + #define UART_PUT_STAT(p, v) bfin_write32(port_membase(p) + OFFSET_STAT, v) 210 + 211 + #define UART_CLEAR_IER(p, v) bfin_write32(port_membase(p) + OFFSET_IER_CLEAR, v) 212 + #define UART_GET_IER(p) bfin_read32(port_membase(p) + OFFSET_IER) 213 + #define UART_SET_IER(p, v) bfin_write32(port_membase(p) + OFFSET_IER_SET, v) 214 + 215 + #define UART_CLEAR_DLAB(p) /* MMRs not muxed on BF60x */ 216 + #define UART_SET_DLAB(p) /* MMRs not muxed on BF60x */ 217 + 218 + #define UART_CLEAR_LSR(p) UART_PUT_STAT(p, -1) 219 + #define UART_GET_LSR(p) UART_GET_STAT(p) 220 + #define UART_PUT_LSR(p, v) UART_PUT_STAT(p, v) 221 + 222 + /* This handles hard CTS/RTS */ 223 + #define BFIN_UART_CTSRTS_HARD 224 + #define UART_CLEAR_SCTS(p) UART_PUT_STAT(p, SCTS) 225 + #define UART_GET_CTS(x) (UART_GET_MSR(x) & CTS) 226 + #define UART_DISABLE_RTS(x) UART_PUT_MCR(x, UART_GET_MCR(x) & ~(ARTS | MRTS)) 227 + #define UART_ENABLE_RTS(x) UART_PUT_MCR(x, UART_GET_MCR(x) | MRTS | ARTS) 228 + #define UART_ENABLE_INTS(x, v) UART_SET_IER(x, v) 229 + #define UART_DISABLE_INTS(x) UART_CLEAR_IER(x, 0xF) 230 + 231 + #else /* BFIN_UART_BF60X_STYLE */ 271 232 272 233 #define UART_GET_CHAR(p) bfin_read16(port_membase(p) + OFFSET_RBR) 273 234 #define UART_GET_DLL(p) bfin_read16(port_membase(p) + OFFSET_DLL) 274 235 #define UART_GET_DLH(p) bfin_read16(port_membase(p) + OFFSET_DLH) 236 + #define UART_GET_CLK(p) ((UART_GET_DLH(p) << 8) | UART_GET_DLL(p)) 275 237 #define UART_GET_GCTL(p) bfin_read16(port_membase(p) + OFFSET_GCTL) 276 238 #define UART_GET_LCR(p) bfin_read16(port_membase(p) + OFFSET_LCR) 277 239 #define UART_GET_MCR(p) bfin_read16(port_membase(p) + OFFSET_MCR) ··· 325 197 #define UART_PUT_CHAR(p, v) bfin_write16(port_membase(p) + OFFSET_THR, v) 326 198 #define UART_PUT_DLL(p, v) bfin_write16(port_membase(p) + OFFSET_DLL, v) 327 199 #define UART_PUT_DLH(p, v) bfin_write16(port_membase(p) + OFFSET_DLH, v) 200 + #define UART_PUT_CLK(p, v) do \ 201 + {\ 202 + UART_PUT_DLL(p, v & 0xFF); \ 203 + UART_PUT_DLH(p, (v >> 8) & 0xFF); } while (0); 204 + 328 205 #define UART_PUT_GCTL(p, v) bfin_write16(port_membase(p) + OFFSET_GCTL, v) 329 206 #define UART_PUT_LCR(p, v) bfin_write16(port_membase(p) + OFFSET_LCR, v) 330 207 #define UART_PUT_MCR(p, v) bfin_write16(port_membase(p) + OFFSET_MCR, v) ··· 366 233 #define UART_CLEAR_DLAB(p) do { UART_PUT_LCR(p, UART_GET_LCR(p) & ~DLAB); SSYNC(); } while (0) 367 234 #define UART_SET_DLAB(p) do { UART_PUT_LCR(p, UART_GET_LCR(p) | DLAB); SSYNC(); } while (0) 368 235 236 + #define get_lsr_cache(uart) (((struct bfin_serial_port *)(uart))->lsr) 237 + #define put_lsr_cache(uart, v) (((struct bfin_serial_port *)(uart))->lsr = (v)) 238 + 239 + /* 369 240 #ifndef put_lsr_cache 370 241 # define put_lsr_cache(p, v) 371 242 #endif 372 243 #ifndef get_lsr_cache 373 244 # define get_lsr_cache(p) 0 374 245 #endif 246 + */ 375 247 376 248 /* The hardware clears the LSR bits upon read, so we need to cache 377 249 * some of the more fun bits in software so they don't get lost ··· 405 267 #define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v) 406 268 #define UART_DISABLE_INTS(x) UART_PUT_IER(x, 0) 407 269 408 - #endif 270 + #endif /* BFIN_UART_BF54X_STYLE */ 271 + 272 + #endif /* BFIN_UART_BF60X_STYLE */ 409 273 410 274 #ifndef BFIN_UART_TX_FIFO_SIZE 411 275 # define BFIN_UART_TX_FIFO_SIZE 2
+118 -21
arch/blackfin/include/asm/dma.h
··· 22 22 #define DATA_SIZE_8 0 23 23 #define DATA_SIZE_16 1 24 24 #define DATA_SIZE_32 2 25 + #ifdef CONFIG_BF60x 26 + #define DATA_SIZE_64 3 27 + #endif 25 28 26 29 #define DMA_FLOW_STOP 0 27 30 #define DMA_FLOW_AUTO 1 31 + #ifdef CONFIG_BF60x 32 + #define DMA_FLOW_LIST 4 33 + #define DMA_FLOW_ARRAY 5 34 + #define DMA_FLOW_LIST_DEMAND 6 35 + #define DMA_FLOW_ARRAY_DEMAND 7 36 + #else 28 37 #define DMA_FLOW_ARRAY 4 29 38 #define DMA_FLOW_SMALL 6 30 39 #define DMA_FLOW_LARGE 7 40 + #endif 31 41 32 42 #define DIMENSION_LINEAR 0 33 43 #define DIMENSION_2D 1 ··· 46 36 #define DIR_WRITE 1 47 37 48 38 #define INTR_DISABLE 0 39 + #ifdef CONFIG_BF60x 40 + #define INTR_ON_PERI 1 41 + #endif 49 42 #define INTR_ON_BUF 2 50 43 #define INTR_ON_ROW 3 51 44 52 45 #define DMA_NOSYNC_KEEP_DMA_BUF 0 53 46 #define DMA_SYNC_RESTART 1 54 47 48 + #ifdef DMA_MMR_SIZE_32 49 + #define DMA_MMR_SIZE_TYPE long 50 + #define DMA_MMR_READ bfin_read32 51 + #define DMA_MMR_WRITE bfin_write32 52 + #else 53 + #define DMA_MMR_SIZE_TYPE short 54 + #define DMA_MMR_READ bfin_read16 55 + #define DMA_MMR_WRITE bfin_write16 56 + #endif 57 + 58 + struct dma_desc_array { 59 + unsigned long start_addr; 60 + unsigned DMA_MMR_SIZE_TYPE cfg; 61 + unsigned DMA_MMR_SIZE_TYPE x_count; 62 + DMA_MMR_SIZE_TYPE x_modify; 63 + } __attribute__((packed)); 64 + 55 65 struct dmasg { 56 66 void *next_desc_addr; 57 67 unsigned long start_addr; 58 - unsigned short cfg; 59 - unsigned short x_count; 60 - short x_modify; 61 - unsigned short y_count; 62 - short y_modify; 68 + unsigned DMA_MMR_SIZE_TYPE cfg; 69 + unsigned DMA_MMR_SIZE_TYPE x_count; 70 + DMA_MMR_SIZE_TYPE x_modify; 71 + unsigned DMA_MMR_SIZE_TYPE y_count; 72 + DMA_MMR_SIZE_TYPE y_modify; 63 73 } __attribute__((packed)); 64 74 65 75 struct dma_register { 66 76 void *next_desc_ptr; /* DMA Next Descriptor Pointer register */ 67 77 unsigned long start_addr; /* DMA Start address register */ 78 + #ifdef CONFIG_BF60x 79 + unsigned long cfg; /* DMA Configuration register */ 68 80 81 + unsigned long x_count; /* DMA x_count register */ 82 + 83 + long x_modify; /* DMA x_modify register */ 84 + 85 + unsigned long y_count; /* DMA y_count register */ 86 + 87 + long y_modify; /* DMA y_modify register */ 88 + 89 + unsigned long reserved; 90 + unsigned long reserved2; 91 + 92 + void *curr_desc_ptr; /* DMA Current Descriptor Pointer 93 + register */ 94 + void *prev_desc_ptr; /* DMA previous initial Descriptor Pointer 95 + register */ 96 + unsigned long curr_addr_ptr; /* DMA Current Address Pointer 97 + register */ 98 + unsigned long irq_status; /* DMA irq status register */ 99 + 100 + unsigned long curr_x_count; /* DMA Current x-count register */ 101 + 102 + unsigned long curr_y_count; /* DMA Current y-count register */ 103 + 104 + unsigned long reserved3; 105 + 106 + unsigned long bw_limit_count; /* DMA band width limit count register */ 107 + unsigned long curr_bw_limit_count; /* DMA Current band width limit 108 + count register */ 109 + unsigned long bw_monitor_count; /* DMA band width limit count register */ 110 + unsigned long curr_bw_monitor_count; /* DMA Current band width limit 111 + count register */ 112 + #else 69 113 unsigned short cfg; /* DMA Configuration register */ 70 114 unsigned short dummy1; /* DMA Configuration register */ 71 115 ··· 156 92 unsigned short dummy9; 157 93 158 94 unsigned long reserved3; 95 + #endif 159 96 160 97 }; 161 98 ··· 196 131 { 197 132 dma_ch[channel].regs->curr_desc_ptr = addr; 198 133 } 199 - static inline void set_dma_x_count(unsigned int channel, unsigned short x_count) 134 + static inline void set_dma_x_count(unsigned int channel, unsigned DMA_MMR_SIZE_TYPE x_count) 200 135 { 201 136 dma_ch[channel].regs->x_count = x_count; 202 137 } 203 - static inline void set_dma_y_count(unsigned int channel, unsigned short y_count) 138 + static inline void set_dma_y_count(unsigned int channel, unsigned DMA_MMR_SIZE_TYPE y_count) 204 139 { 205 140 dma_ch[channel].regs->y_count = y_count; 206 141 } 207 - static inline void set_dma_x_modify(unsigned int channel, short x_modify) 142 + static inline void set_dma_x_modify(unsigned int channel, DMA_MMR_SIZE_TYPE x_modify) 208 143 { 209 144 dma_ch[channel].regs->x_modify = x_modify; 210 145 } 211 - static inline void set_dma_y_modify(unsigned int channel, short y_modify) 146 + static inline void set_dma_y_modify(unsigned int channel, DMA_MMR_SIZE_TYPE y_modify) 212 147 { 213 148 dma_ch[channel].regs->y_modify = y_modify; 214 149 } 215 - static inline void set_dma_config(unsigned int channel, unsigned short config) 150 + static inline void set_dma_config(unsigned int channel, unsigned DMA_MMR_SIZE_TYPE config) 216 151 { 217 152 dma_ch[channel].regs->cfg = config; 218 153 } ··· 221 156 dma_ch[channel].regs->curr_addr_ptr = addr; 222 157 } 223 158 224 - static inline unsigned short 225 - set_bfin_dma_config(char direction, char flow_mode, 226 - char intr_mode, char dma_mode, char width, char syncmode) 159 + #ifdef CONFIG_BF60x 160 + static inline unsigned long 161 + set_bfin_dma_config2(char direction, char flow_mode, char intr_mode, 162 + char dma_mode, char mem_width, char syncmode, char peri_width) 227 163 { 228 - return (direction << 1) | (width << 2) | (dma_mode << 4) | 164 + unsigned long config = 0; 165 + 166 + switch (intr_mode) { 167 + case INTR_ON_BUF: 168 + if (dma_mode == DIMENSION_2D) 169 + config = DI_EN_Y; 170 + else 171 + config = DI_EN_X; 172 + break; 173 + case INTR_ON_ROW: 174 + config = DI_EN_X; 175 + break; 176 + case INTR_ON_PERI: 177 + config = DI_EN_P; 178 + break; 179 + }; 180 + 181 + return config | (direction << 1) | (mem_width << 8) | (dma_mode << 26) | 182 + (flow_mode << 12) | (syncmode << 2) | (peri_width << 4); 183 + } 184 + #endif 185 + 186 + static inline unsigned DMA_MMR_SIZE_TYPE 187 + set_bfin_dma_config(char direction, char flow_mode, 188 + char intr_mode, char dma_mode, char mem_width, char syncmode) 189 + { 190 + #ifdef CONFIG_BF60x 191 + return set_bfin_dma_config2(direction, flow_mode, intr_mode, dma_mode, 192 + mem_width, syncmode, mem_width); 193 + #else 194 + return (direction << 1) | (mem_width << 2) | (dma_mode << 4) | 229 195 (intr_mode << 6) | (flow_mode << 12) | (syncmode << 5); 196 + #endif 230 197 } 231 198 232 - static inline unsigned short get_dma_curr_irqstat(unsigned int channel) 199 + static inline unsigned DMA_MMR_SIZE_TYPE get_dma_curr_irqstat(unsigned int channel) 233 200 { 234 201 return dma_ch[channel].regs->irq_status; 235 202 } 236 - static inline unsigned short get_dma_curr_xcount(unsigned int channel) 203 + static inline unsigned DMA_MMR_SIZE_TYPE get_dma_curr_xcount(unsigned int channel) 237 204 { 238 205 return dma_ch[channel].regs->curr_x_count; 239 206 } 240 - static inline unsigned short get_dma_curr_ycount(unsigned int channel) 207 + static inline unsigned DMA_MMR_SIZE_TYPE get_dma_curr_ycount(unsigned int channel) 241 208 { 242 209 return dma_ch[channel].regs->curr_y_count; 243 210 } ··· 281 184 { 282 185 return dma_ch[channel].regs->curr_desc_ptr; 283 186 } 284 - static inline unsigned short get_dma_config(unsigned int channel) 187 + static inline unsigned DMA_MMR_SIZE_TYPE get_dma_config(unsigned int channel) 285 188 { 286 189 return dma_ch[channel].regs->cfg; 287 190 } ··· 300 203 301 204 dma_ch[channel].regs->next_desc_ptr = sg; 302 205 dma_ch[channel].regs->cfg = 303 - (dma_ch[channel].regs->cfg & ~(0xf << 8)) | 304 - ((ndsize & 0xf) << 8); 206 + (dma_ch[channel].regs->cfg & ~NDSIZE) | 207 + ((ndsize << NDSIZE_OFFSET) & NDSIZE); 305 208 } 306 209 307 210 static inline int dma_channel_active(unsigned int channel) ··· 336 239 } 337 240 static inline void clear_dma_irqstat(unsigned int channel) 338 241 { 339 - dma_ch[channel].regs->irq_status = DMA_DONE | DMA_ERR; 242 + dma_ch[channel].regs->irq_status = DMA_DONE | DMA_ERR | DMA_PIRQ; 340 243 } 341 244 342 245 void *dma_memcpy(void *dest, const void *src, size_t count);
+17 -13
arch/blackfin/include/asm/fixed_code.h
··· 29 29 #endif 30 30 #endif 31 31 32 - #define FIXED_CODE_START 0x400 32 + #ifndef CONFIG_PHY_RAM_BASE_ADDRESS 33 + #define CONFIG_PHY_RAM_BASE_ADDRESS 0x0 34 + #endif 33 35 34 - #define SIGRETURN_STUB 0x400 36 + #define FIXED_CODE_START (CONFIG_PHY_RAM_BASE_ADDRESS + 0x400) 35 37 36 - #define ATOMIC_SEQS_START 0x410 38 + #define SIGRETURN_STUB (CONFIG_PHY_RAM_BASE_ADDRESS + 0x400) 37 39 38 - #define ATOMIC_XCHG32 0x410 39 - #define ATOMIC_CAS32 0x420 40 - #define ATOMIC_ADD32 0x430 41 - #define ATOMIC_SUB32 0x440 42 - #define ATOMIC_IOR32 0x450 43 - #define ATOMIC_AND32 0x460 44 - #define ATOMIC_XOR32 0x470 40 + #define ATOMIC_SEQS_START (CONFIG_PHY_RAM_BASE_ADDRESS + 0x410) 45 41 46 - #define ATOMIC_SEQS_END 0x480 42 + #define ATOMIC_XCHG32 (CONFIG_PHY_RAM_BASE_ADDRESS + 0x410) 43 + #define ATOMIC_CAS32 (CONFIG_PHY_RAM_BASE_ADDRESS + 0x420) 44 + #define ATOMIC_ADD32 (CONFIG_PHY_RAM_BASE_ADDRESS + 0x430) 45 + #define ATOMIC_SUB32 (CONFIG_PHY_RAM_BASE_ADDRESS + 0x440) 46 + #define ATOMIC_IOR32 (CONFIG_PHY_RAM_BASE_ADDRESS + 0x450) 47 + #define ATOMIC_AND32 (CONFIG_PHY_RAM_BASE_ADDRESS + 0x460) 48 + #define ATOMIC_XOR32 (CONFIG_PHY_RAM_BASE_ADDRESS + 0x470) 47 49 48 - #define SAFE_USER_INSTRUCTION 0x480 50 + #define ATOMIC_SEQS_END (CONFIG_PHY_RAM_BASE_ADDRESS + 0x480) 49 51 50 - #define FIXED_CODE_END 0x490 52 + #define SAFE_USER_INSTRUCTION (CONFIG_PHY_RAM_BASE_ADDRESS + 0x480) 53 + 54 + #define FIXED_CODE_END (CONFIG_PHY_RAM_BASE_ADDRESS + 0x490) 51 55 52 56 #endif
+3 -2
arch/blackfin/include/asm/page.h
··· 7 7 #ifndef _BLACKFIN_PAGE_H 8 8 #define _BLACKFIN_PAGE_H 9 9 10 - #include <asm-generic/page.h> 11 - #define MAP_NR(addr) (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT) 10 + #define ARCH_PFN_OFFSET (CONFIG_PHY_RAM_BASE_ADDRESS >> PAGE_SHIFT) 11 + #define MAP_NR(addr) ((unsigned long)(addr) >> PAGE_SHIFT) 12 12 13 13 #define VM_DATA_DEFAULT_FLAGS \ 14 14 (VM_READ | VM_WRITE | \ 15 15 ((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \ 16 16 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) 17 17 18 + #include <asm-generic/page.h> 18 19 #include <asm-generic/memory_model.h> 19 20 #include <asm-generic/getorder.h> 20 21
+106 -37
arch/blackfin/kernel/bfin_dma.c
··· 45 45 atomic_set(&dma_ch[i].chan_status, 0); 46 46 dma_ch[i].regs = dma_io_base_addr[i]; 47 47 } 48 + #ifdef CH_MEM_STREAM3_SRC 49 + /* Mark MEMDMA Channel 3 as requested since we're using it internally */ 50 + request_dma(CH_MEM_STREAM3_DEST, "Blackfin dma_memcpy"); 51 + request_dma(CH_MEM_STREAM3_SRC, "Blackfin dma_memcpy"); 52 + #else 48 53 /* Mark MEMDMA Channel 0 as requested since we're using it internally */ 49 54 request_dma(CH_MEM_STREAM0_DEST, "Blackfin dma_memcpy"); 50 55 request_dma(CH_MEM_STREAM0_SRC, "Blackfin dma_memcpy"); 56 + #endif 51 57 52 58 #if defined(CONFIG_DEB_DMA_URGENT) 53 59 bfin_write_EBIU_DDRQUE(bfin_read_EBIU_DDRQUE() ··· 210 204 # ifndef MAX_DMA_SUSPEND_CHANNELS 211 205 # define MAX_DMA_SUSPEND_CHANNELS MAX_DMA_CHANNELS 212 206 # endif 207 + # ifndef CONFIG_BF60x 213 208 int blackfin_dma_suspend(void) 214 209 { 215 210 int i; ··· 220 213 printk(KERN_ERR "DMA Channel %d failed to suspend\n", i); 221 214 return -EBUSY; 222 215 } 223 - 224 216 if (i < MAX_DMA_SUSPEND_CHANNELS) 225 217 dma_ch[i].saved_peripheral_map = dma_ch[i].regs->peripheral_map; 226 218 } ··· 236 230 237 231 for (i = 0; i < MAX_DMA_CHANNELS; ++i) { 238 232 dma_ch[i].regs->cfg = 0; 239 - 240 233 if (i < MAX_DMA_SUSPEND_CHANNELS) 241 234 dma_ch[i].regs->peripheral_map = dma_ch[i].saved_peripheral_map; 242 235 } ··· 243 238 bfin_write_DMAC_TC_PER(0x0111); 244 239 #endif 245 240 } 241 + # else 242 + int blackfin_dma_suspend(void) 243 + { 244 + return 0; 245 + } 246 + 247 + void blackfin_dma_resume(void) 248 + { 249 + } 250 + #endif 246 251 #endif 247 252 248 253 /** ··· 294 279 src_ch = (struct dma_register *)MDMA_S0_NEXT_DESC_PTR; 295 280 } 296 281 297 - if (!bfin_read16(&src_ch->cfg)) 282 + if (!DMA_MMR_READ(&src_ch->cfg)) 298 283 break; 299 - else if (bfin_read16(&dst_ch->irq_status) & DMA_DONE) { 300 - bfin_write16(&src_ch->cfg, 0); 284 + else if (DMA_MMR_READ(&dst_ch->irq_status) & DMA_DONE) { 285 + DMA_MMR_WRITE(&src_ch->cfg, 0); 301 286 break; 302 287 } 303 288 } ··· 310 295 311 296 /* Destination */ 312 297 bfin_write32(&dst_ch->start_addr, dst); 313 - bfin_write16(&dst_ch->x_count, size >> 2); 314 - bfin_write16(&dst_ch->x_modify, 1 << 2); 315 - bfin_write16(&dst_ch->irq_status, DMA_DONE | DMA_ERR); 298 + DMA_MMR_WRITE(&dst_ch->x_count, size >> 2); 299 + DMA_MMR_WRITE(&dst_ch->x_modify, 1 << 2); 300 + DMA_MMR_WRITE(&dst_ch->irq_status, DMA_DONE | DMA_ERR); 316 301 317 302 /* Source */ 318 303 bfin_write32(&src_ch->start_addr, src); 319 - bfin_write16(&src_ch->x_count, size >> 2); 320 - bfin_write16(&src_ch->x_modify, 1 << 2); 321 - bfin_write16(&src_ch->irq_status, DMA_DONE | DMA_ERR); 304 + DMA_MMR_WRITE(&src_ch->x_count, size >> 2); 305 + DMA_MMR_WRITE(&src_ch->x_modify, 1 << 2); 306 + DMA_MMR_WRITE(&src_ch->irq_status, DMA_DONE | DMA_ERR); 322 307 323 308 /* Enable */ 324 - bfin_write16(&src_ch->cfg, DMAEN | WDSIZE_32); 325 - bfin_write16(&dst_ch->cfg, WNR | DI_EN | DMAEN | WDSIZE_32); 309 + DMA_MMR_WRITE(&src_ch->cfg, DMAEN | WDSIZE_32); 310 + DMA_MMR_WRITE(&dst_ch->cfg, WNR | DI_EN_X | DMAEN | WDSIZE_32); 326 311 327 312 /* Since we are atomic now, don't use the workaround ssync */ 328 313 __builtin_bfin_ssync(); 314 + 315 + #ifdef CONFIG_BF60x 316 + /* Work around a possible MDMA anomaly. Running 2 MDMA channels to 317 + * transfer DDR data to L1 SRAM may corrupt data. 318 + * Should be reverted after this issue is root caused. 319 + */ 320 + while (!(DMA_MMR_READ(&dst_ch->irq_status) & DMA_DONE)) 321 + continue; 322 + #endif 329 323 } 330 324 331 325 void __init early_dma_memcpy_done(void) ··· 360 336 __builtin_bfin_ssync(); 361 337 } 362 338 339 + #ifdef CH_MEM_STREAM3_SRC 340 + #define bfin_read_MDMA_S_CONFIG bfin_read_MDMA_S3_CONFIG 341 + #define bfin_write_MDMA_S_CONFIG bfin_write_MDMA_S3_CONFIG 342 + #define bfin_write_MDMA_S_START_ADDR bfin_write_MDMA_S3_START_ADDR 343 + #define bfin_write_MDMA_S_IRQ_STATUS bfin_write_MDMA_S3_IRQ_STATUS 344 + #define bfin_write_MDMA_S_X_COUNT bfin_write_MDMA_S3_X_COUNT 345 + #define bfin_write_MDMA_S_X_MODIFY bfin_write_MDMA_S3_X_MODIFY 346 + #define bfin_write_MDMA_S_Y_COUNT bfin_write_MDMA_S3_Y_COUNT 347 + #define bfin_write_MDMA_S_Y_MODIFY bfin_write_MDMA_S3_Y_MODIFY 348 + #define bfin_write_MDMA_D_CONFIG bfin_write_MDMA_D3_CONFIG 349 + #define bfin_write_MDMA_D_START_ADDR bfin_write_MDMA_D3_START_ADDR 350 + #define bfin_read_MDMA_D_IRQ_STATUS bfin_read_MDMA_D3_IRQ_STATUS 351 + #define bfin_write_MDMA_D_IRQ_STATUS bfin_write_MDMA_D3_IRQ_STATUS 352 + #define bfin_write_MDMA_D_X_COUNT bfin_write_MDMA_D3_X_COUNT 353 + #define bfin_write_MDMA_D_X_MODIFY bfin_write_MDMA_D3_X_MODIFY 354 + #define bfin_write_MDMA_D_Y_COUNT bfin_write_MDMA_D3_Y_COUNT 355 + #define bfin_write_MDMA_D_Y_MODIFY bfin_write_MDMA_D3_Y_MODIFY 356 + #else 357 + #define bfin_read_MDMA_S_CONFIG bfin_read_MDMA_S0_CONFIG 358 + #define bfin_write_MDMA_S_CONFIG bfin_write_MDMA_S0_CONFIG 359 + #define bfin_write_MDMA_S_START_ADDR bfin_write_MDMA_S0_START_ADDR 360 + #define bfin_write_MDMA_S_IRQ_STATUS bfin_write_MDMA_S0_IRQ_STATUS 361 + #define bfin_write_MDMA_S_X_COUNT bfin_write_MDMA_S0_X_COUNT 362 + #define bfin_write_MDMA_S_X_MODIFY bfin_write_MDMA_S0_X_MODIFY 363 + #define bfin_write_MDMA_S_Y_COUNT bfin_write_MDMA_S0_Y_COUNT 364 + #define bfin_write_MDMA_S_Y_MODIFY bfin_write_MDMA_S0_Y_MODIFY 365 + #define bfin_write_MDMA_D_CONFIG bfin_write_MDMA_D0_CONFIG 366 + #define bfin_write_MDMA_D_START_ADDR bfin_write_MDMA_D0_START_ADDR 367 + #define bfin_read_MDMA_D_IRQ_STATUS bfin_read_MDMA_D0_IRQ_STATUS 368 + #define bfin_write_MDMA_D_IRQ_STATUS bfin_write_MDMA_D0_IRQ_STATUS 369 + #define bfin_write_MDMA_D_X_COUNT bfin_write_MDMA_D0_X_COUNT 370 + #define bfin_write_MDMA_D_X_MODIFY bfin_write_MDMA_D0_X_MODIFY 371 + #define bfin_write_MDMA_D_Y_COUNT bfin_write_MDMA_D0_Y_COUNT 372 + #define bfin_write_MDMA_D_Y_MODIFY bfin_write_MDMA_D0_Y_MODIFY 373 + #endif 374 + 363 375 /** 364 376 * __dma_memcpy - program the MDMA registers 365 377 * ··· 418 358 */ 419 359 __builtin_bfin_ssync(); 420 360 421 - if (bfin_read_MDMA_S0_CONFIG()) 422 - while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE)) 361 + if (bfin_read_MDMA_S_CONFIG()) 362 + while (!(bfin_read_MDMA_D_IRQ_STATUS() & DMA_DONE)) 423 363 continue; 424 364 425 365 if (conf & DMA2D) { ··· 434 374 u32 shift = abs(dmod) >> 1; 435 375 size_t ycnt = cnt >> (16 - shift); 436 376 cnt = 1 << (16 - shift); 437 - bfin_write_MDMA_D0_Y_COUNT(ycnt); 438 - bfin_write_MDMA_S0_Y_COUNT(ycnt); 439 - bfin_write_MDMA_D0_Y_MODIFY(dmod); 440 - bfin_write_MDMA_S0_Y_MODIFY(smod); 377 + bfin_write_MDMA_D_Y_COUNT(ycnt); 378 + bfin_write_MDMA_S_Y_COUNT(ycnt); 379 + bfin_write_MDMA_D_Y_MODIFY(dmod); 380 + bfin_write_MDMA_S_Y_MODIFY(smod); 441 381 } 442 382 443 - bfin_write_MDMA_D0_START_ADDR(daddr); 444 - bfin_write_MDMA_D0_X_COUNT(cnt); 445 - bfin_write_MDMA_D0_X_MODIFY(dmod); 446 - bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR); 383 + bfin_write_MDMA_D_START_ADDR(daddr); 384 + bfin_write_MDMA_D_X_COUNT(cnt); 385 + bfin_write_MDMA_D_X_MODIFY(dmod); 386 + bfin_write_MDMA_D_IRQ_STATUS(DMA_DONE | DMA_ERR); 447 387 448 - bfin_write_MDMA_S0_START_ADDR(saddr); 449 - bfin_write_MDMA_S0_X_COUNT(cnt); 450 - bfin_write_MDMA_S0_X_MODIFY(smod); 451 - bfin_write_MDMA_S0_IRQ_STATUS(DMA_DONE | DMA_ERR); 388 + bfin_write_MDMA_S_START_ADDR(saddr); 389 + bfin_write_MDMA_S_X_COUNT(cnt); 390 + bfin_write_MDMA_S_X_MODIFY(smod); 391 + bfin_write_MDMA_S_IRQ_STATUS(DMA_DONE | DMA_ERR); 452 392 453 - bfin_write_MDMA_S0_CONFIG(DMAEN | conf); 454 - bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | conf); 393 + bfin_write_MDMA_S_CONFIG(DMAEN | conf); 394 + if (conf & DMA2D) 395 + bfin_write_MDMA_D_CONFIG(WNR | DI_EN_Y | DMAEN | conf); 396 + else 397 + bfin_write_MDMA_D_CONFIG(WNR | DI_EN_X | DMAEN | conf); 455 398 456 399 spin_unlock_irqrestore(&mdma_lock, flags); 457 400 458 401 SSYNC(); 459 402 460 - while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE)) 461 - if (bfin_read_MDMA_S0_CONFIG()) 403 + while (!(bfin_read_MDMA_D_IRQ_STATUS() & DMA_DONE)) 404 + if (bfin_read_MDMA_S_CONFIG()) 462 405 continue; 463 406 else 464 407 return; 465 408 466 - bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR); 409 + bfin_write_MDMA_D_IRQ_STATUS(DMA_DONE | DMA_ERR); 467 410 468 - bfin_write_MDMA_S0_CONFIG(0); 469 - bfin_write_MDMA_D0_CONFIG(0); 411 + bfin_write_MDMA_S_CONFIG(0); 412 + bfin_write_MDMA_D_CONFIG(0); 470 413 } 471 414 472 415 /** ··· 511 448 } 512 449 size >>= shift; 513 450 451 + #ifndef DMA_MMR_SIZE_32 514 452 if (size > 0x10000) 515 453 conf |= DMA2D; 454 + #endif 516 455 517 456 __dma_memcpy(dst, mod, src, mod, size, conf); 518 457 ··· 553 488 */ 554 489 void *dma_memcpy_nocache(void *pdst, const void *psrc, size_t size) 555 490 { 491 + #ifdef DMA_MMR_SIZE_32 492 + _dma_memcpy(pdst, psrc, size); 493 + #else 556 494 size_t bulk, rest; 557 495 558 496 bulk = size & ~0xffff; ··· 563 495 if (bulk) 564 496 _dma_memcpy(pdst, psrc, bulk); 565 497 _dma_memcpy(pdst + bulk, psrc + bulk, rest); 498 + #endif 566 499 return pdst; 567 500 } 568 501 EXPORT_SYMBOL(dma_memcpy_nocache); ··· 583 514 } 584 515 EXPORT_SYMBOL(safe_dma_memcpy); 585 516 586 - static void _dma_out(unsigned long addr, unsigned long buf, unsigned short len, 517 + static void _dma_out(unsigned long addr, unsigned long buf, unsigned DMA_MMR_SIZE_TYPE len, 587 518 u16 size, u16 dma_size) 588 519 { 589 520 blackfin_dcache_flush_range(buf, buf + len * size); 590 521 __dma_memcpy(addr, 0, buf, size, len, dma_size); 591 522 } 592 523 593 - static void _dma_in(unsigned long addr, unsigned long buf, unsigned short len, 524 + static void _dma_in(unsigned long addr, unsigned long buf, unsigned DMA_MMR_SIZE_TYPE len, 594 525 u16 size, u16 dma_size) 595 526 { 596 527 blackfin_dcache_invalidate_range(buf, buf + len * size); ··· 598 529 } 599 530 600 531 #define MAKE_DMA_IO(io, bwl, isize, dmasize, cnst) \ 601 - void dma_##io##s##bwl(unsigned long addr, cnst void *buf, unsigned short len) \ 532 + void dma_##io##s##bwl(unsigned long addr, cnst void *buf, unsigned DMA_MMR_SIZE_TYPE len) \ 602 533 { \ 603 534 _dma_##io(addr, (unsigned long)buf, len, isize, WDSIZE_##dmasize); \ 604 535 } \
+14 -13
arch/blackfin/kernel/bfin_gpio.c
··· 58 58 (struct gpio_port_t *) FIO0_FLAG_D, 59 59 (struct gpio_port_t *) FIO1_FLAG_D, 60 60 (struct gpio_port_t *) FIO2_FLAG_D, 61 - #elif defined(CONFIG_BF54x) 61 + #elif defined(CONFIG_BF54x) || defined(CONFIG_BF60x) 62 62 (struct gpio_port_t *)PORTA_FER, 63 63 (struct gpio_port_t *)PORTB_FER, 64 64 (struct gpio_port_t *)PORTC_FER, ··· 66 66 (struct gpio_port_t *)PORTE_FER, 67 67 (struct gpio_port_t *)PORTF_FER, 68 68 (struct gpio_port_t *)PORTG_FER, 69 + #elif defined(CONFIG_BF54x) 69 70 (struct gpio_port_t *)PORTH_FER, 70 71 (struct gpio_port_t *)PORTI_FER, 71 72 (struct gpio_port_t *)PORTJ_FER, ··· 211 210 else 212 211 *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio); 213 212 SSYNC(); 214 - #elif defined(CONFIG_BF54x) 213 + #elif defined(CONFIG_BF54x) || defined(CONFIG_BF60x) 215 214 if (usage == GPIO_USAGE) 216 215 gpio_array[gpio_bank(gpio)]->port_fer &= ~gpio_bit(gpio); 217 216 else ··· 300 299 pmux |= (function << offset); 301 300 bfin_write_PORT_MUX(pmux); 302 301 } 303 - #elif defined(CONFIG_BF54x) 302 + #elif defined(CONFIG_BF54x) || defined(CONFIG_BF60x) 304 303 inline void portmux_setup(unsigned short per) 305 304 { 306 305 u16 ident = P_IDENT(per); ··· 378 377 } 379 378 #endif 380 379 381 - #ifndef CONFIG_BF54x 380 + #if !(defined(CONFIG_BF54x) || defined(CONFIG_BF60x)) 382 381 /*********************************************************** 383 382 * 384 383 * FUNCTIONS: Blackfin General Purpose Ports Access Functions ··· 681 680 682 681 683 682 #endif 684 - #else /* CONFIG_BF54x */ 683 + #else /* CONFIG_BF54x || CONFIG_BF60x */ 685 684 #ifdef CONFIG_PM 686 685 687 686 int bfin_pm_standby_ctrl(unsigned ctrl) ··· 727 726 } 728 727 EXPORT_SYMBOL(get_gpio_dir); 729 728 730 - #endif /* CONFIG_BF54x */ 729 + #endif /* CONFIG_BF54x || CONFIG_BF60x */ 731 730 732 731 /*********************************************************** 733 732 * ··· 784 783 * be requested and used by several drivers 785 784 */ 786 785 787 - #ifdef CONFIG_BF54x 786 + #if defined(CONFIG_BF54x) || defined(CONFIG_BF60x) 788 787 if (!((per & P_MAYSHARE) && get_portmux(per) == P_FUNCT2MUX(per))) { 789 788 #else 790 789 if (!(per & P_MAYSHARE)) { ··· 938 937 printk(KERN_NOTICE "bfin-gpio: GPIO %d is already reserved as gpio-irq!" 939 938 " (Documentation/blackfin/bfin-gpio-notes.txt)\n", gpio); 940 939 } 941 - #ifndef CONFIG_BF54x 940 + #if !(defined(CONFIG_BF54x) || defined(CONFIG_BF60x)) 942 941 else { /* Reset POLAR setting when acquiring a gpio for the first time */ 943 942 set_gpio_polar(gpio, 0); 944 943 } ··· 1111 1110 1112 1111 static inline void __bfin_gpio_direction_input(unsigned gpio) 1113 1112 { 1114 - #ifdef CONFIG_BF54x 1113 + #if defined(CONFIG_BF54x) || defined(CONFIG_BF60x) 1115 1114 gpio_array[gpio_bank(gpio)]->dir_clear = gpio_bit(gpio); 1116 1115 #else 1117 1116 gpio_array[gpio_bank(gpio)]->dir &= ~gpio_bit(gpio); ··· 1139 1138 1140 1139 void bfin_gpio_irq_prepare(unsigned gpio) 1141 1140 { 1142 - #ifdef CONFIG_BF54x 1141 + #if defined(CONFIG_BF54x) || defined(CONFIG_BF60x) 1143 1142 unsigned long flags; 1144 1143 #endif 1145 1144 1146 1145 port_setup(gpio, GPIO_USAGE); 1147 1146 1148 - #ifdef CONFIG_BF54x 1147 + #if defined(CONFIG_BF54x) || defined(CONFIG_BF60x) 1149 1148 flags = hard_local_irq_save(); 1150 1149 __bfin_gpio_direction_input(gpio); 1151 1150 hard_local_irq_restore(flags); ··· 1174 1173 1175 1174 gpio_array[gpio_bank(gpio)]->inen &= ~gpio_bit(gpio); 1176 1175 gpio_set_value(gpio, value); 1177 - #ifdef CONFIG_BF54x 1176 + #if defined(CONFIG_BF54x) || defined(CONFIG_BF60x) 1178 1177 gpio_array[gpio_bank(gpio)]->dir_set = gpio_bit(gpio); 1179 1178 #else 1180 1179 gpio_array[gpio_bank(gpio)]->dir |= gpio_bit(gpio); ··· 1189 1188 1190 1189 int bfin_gpio_get_value(unsigned gpio) 1191 1190 { 1192 - #ifdef CONFIG_BF54x 1191 + #if defined(CONFIG_BF54x) || defined(CONFIG_BF60x) 1193 1192 return (1 & (gpio_array[gpio_bank(gpio)]->data >> gpio_sub_n(gpio))); 1194 1193 #else 1195 1194 unsigned long flags;
+6 -3
arch/blackfin/kernel/debug-mmrs.c
··· 105 105 DEFINE_SYSREG(syscfg, , CSYNC()); 106 106 #define D_SYSREG(sr) debugfs_create_file(#sr, S_IRUSR|S_IWUSR, parent, NULL, &fops_sysreg_##sr) 107 107 108 + #ifndef CONFIG_BF60x 108 109 /* 109 110 * CAN 110 111 */ ··· 224 223 __DMA(CURR_DESC_PTR, curr_desc_ptr); 225 224 __DMA(CURR_ADDR, curr_addr); 226 225 __DMA(IRQ_STATUS, irq_status); 226 + #ifndef CONFIG_BF60x 227 227 if (strcmp(pfx, "IMDMA") != 0) 228 228 __DMA(PERIPHERAL_MAP, peripheral_map); 229 + #endif 229 230 __DMA(CURR_X_COUNT, curr_x_count); 230 231 __DMA(CURR_Y_COUNT, curr_y_count); 231 232 } ··· 571 568 #endif 572 569 } 573 570 #define UART(num) bfin_debug_mmrs_uart(parent, UART##num##_DLL, num) 574 - 571 + #endif /* CONFIG_BF60x */ 575 572 /* 576 573 * The actual debugfs generation 577 574 */ ··· 743 740 D32(WPDACNT0); 744 741 D32(WPDACNT1); 745 742 D32(WPSTAT); 746 - 743 + #ifndef CONFIG_BF60x 747 744 /* System MMRs */ 748 745 #ifdef ATAPI_CONTROL 749 746 parent = debugfs_create_dir("atapi", top); ··· 1876 1873 1877 1874 } 1878 1875 #endif /* BF54x */ 1879 - 1876 + #endif /* CONFIG_BF60x */ 1880 1877 debug_mmrs_dentry = top; 1881 1878 1882 1879 return 0;
+7 -1
arch/blackfin/kernel/process.c
··· 95 95 idle(); 96 96 rcu_idle_exit(); 97 97 tick_nohz_idle_exit(); 98 - schedule_preempt_disabled(); 98 + preempt_enable_no_resched(); 99 + schedule(); 100 + preempt_disable(); 99 101 } 100 102 } 101 103 ··· 331 329 { 332 330 return in_mem_const_off(addr, size, 0, const_addr, const_size); 333 331 } 332 + #ifdef CONFIG_BF60x 333 + #define ASYNC_ENABLED(bnum, bctlnum) 1 334 + #else 334 335 #define ASYNC_ENABLED(bnum, bctlnum) \ 335 336 ({ \ 336 337 (bfin_read_EBIU_AMGCTL() & 0xe) < ((bnum + 1) << 1) ? 0 : \ 337 338 bfin_read_EBIU_AMBCTL##bctlnum() & B##bnum##RDYEN ? 0 : \ 338 339 1; \ 339 340 }) 341 + #endif 340 342 /* 341 343 * We can't read EBIU banks that aren't enabled or we end up hanging 342 344 * on the access to the async space. Make sure we validate accesses
+5 -1
arch/blackfin/kernel/reboot.c
··· 22 22 __attribute__ ((__l1_text__, __noreturn__)) 23 23 static void bfin_reset(void) 24 24 { 25 + #ifndef CONFIG_BF60x 25 26 if (!ANOMALY_05000353 && !ANOMALY_05000386) 26 27 bfrom_SoftReset((void *)(L1_SCRATCH_START + L1_SCRATCH_LENGTH - 20)); 27 28 ··· 58 57 if (__SILICON_REVISION__ < 1 && bfin_revid() < 1) 59 58 bfin_read_SWRST(); 60 59 #endif 61 - 62 60 /* Wait for the SWRST write to complete. Cannot rely on SSYNC 63 61 * though as the System state is all reset now. 64 62 */ ··· 72 72 while (1) 73 73 /* Issue core reset */ 74 74 asm("raise 1"); 75 + #else 76 + while (1) 77 + bfin_write_RCU0_CTL(0x1); 78 + #endif 75 79 } 76 80 77 81 __attribute__((weak))
+141 -18
arch/blackfin/kernel/setup.c
··· 25 25 #include <asm/cacheflush.h> 26 26 #include <asm/blackfin.h> 27 27 #include <asm/cplbinit.h> 28 + #include <asm/clocks.h> 28 29 #include <asm/div64.h> 29 30 #include <asm/cpu.h> 30 31 #include <asm/fixed_code.h> ··· 551 550 { 552 551 #ifdef CONFIG_MTD_UCLINUX 553 552 unsigned long mtd_phys = 0; 554 - unsigned long n; 555 553 #endif 556 554 unsigned long max_mem; 557 555 ··· 594 594 mtd_size = PAGE_ALIGN(*((unsigned long *)(mtd_phys + 8))); 595 595 596 596 # if defined(CONFIG_EXT2_FS) || defined(CONFIG_EXT3_FS) 597 - n = ext2_image_size((void *)(mtd_phys + 0x400)); 598 - if (n) 599 - mtd_size = PAGE_ALIGN(n * 1024); 597 + if (*((unsigned short *)(mtd_phys + 0x438)) == EXT2_SUPER_MAGIC) 598 + mtd_size = 599 + PAGE_ALIGN(*((unsigned long *)(mtd_phys + 0x404)) << 10); 600 600 # endif 601 601 602 602 # if defined(CONFIG_CRAMFS) ··· 612 612 613 613 /* ROM_FS is XIP, so if we found it, we need to limit memory */ 614 614 if (memory_end > max_mem) { 615 - pr_info("Limiting kernel memory to %liMB due to anomaly 05000263\n", max_mem >> 20); 615 + pr_info("Limiting kernel memory to %liMB due to anomaly 05000263\n", 616 + (max_mem - CONFIG_PHY_RAM_BASE_ADDRESS) >> 20); 616 617 memory_end = max_mem; 617 618 } 618 619 } ··· 643 642 * doesn't exist, or we don't need to - then dont. 644 643 */ 645 644 if (memory_end > max_mem) { 646 - pr_info("Limiting kernel memory to %liMB due to anomaly 05000263\n", max_mem >> 20); 645 + pr_info("Limiting kernel memory to %liMB due to anomaly 05000263\n", 646 + (max_mem - CONFIG_PHY_RAM_BASE_ADDRESS) >> 20); 647 647 memory_end = max_mem; 648 648 } 649 649 ··· 663 661 init_mm.end_data = (unsigned long)_edata; 664 662 init_mm.brk = (unsigned long)0; 665 663 666 - printk(KERN_INFO "Board Memory: %ldMB\n", physical_mem_end >> 20); 667 - printk(KERN_INFO "Kernel Managed Memory: %ldMB\n", _ramend >> 20); 664 + printk(KERN_INFO "Board Memory: %ldMB\n", (physical_mem_end - CONFIG_PHY_RAM_BASE_ADDRESS) >> 20); 665 + printk(KERN_INFO "Kernel Managed Memory: %ldMB\n", (_ramend - CONFIG_PHY_RAM_BASE_ADDRESS) >> 20); 668 666 669 667 printk(KERN_INFO "Memory map:\n" 670 668 " fixedcode = 0x%p-0x%p\n" ··· 707 705 int i; 708 706 709 707 max_pfn = 0; 710 - min_low_pfn = memory_end; 708 + min_low_pfn = PFN_DOWN(memory_end); 711 709 712 710 for (i = 0; i < bfin_memmap.nr_map; i++) { 713 711 unsigned long start, end; ··· 750 748 /* pfn of the first usable page frame after kernel image*/ 751 749 if (min_low_pfn < memory_start >> PAGE_SHIFT) 752 750 min_low_pfn = memory_start >> PAGE_SHIFT; 753 - 754 - start_pfn = PAGE_OFFSET >> PAGE_SHIFT; 751 + start_pfn = CONFIG_PHY_RAM_BASE_ADDRESS >> PAGE_SHIFT; 755 752 end_pfn = memory_end >> PAGE_SHIFT; 756 753 757 754 /* ··· 795 794 } 796 795 797 796 /* reserve memory before memory_start, including bootmap */ 798 - reserve_bootmem(PAGE_OFFSET, 799 - memory_start + bootmap_size + PAGE_SIZE - 1 - PAGE_OFFSET, 797 + reserve_bootmem(CONFIG_PHY_RAM_BASE_ADDRESS, 798 + memory_start + bootmap_size + PAGE_SIZE - 1 - CONFIG_PHY_RAM_BASE_ADDRESS, 800 799 BOOTMEM_DEFAULT); 801 800 } 802 801 ··· 845 844 break; 846 845 } 847 846 switch (ddrctl & 0x30000) { 848 - case DEVWD_4: ret *= 2; 849 - case DEVWD_8: ret *= 2; 850 - case DEVWD_16: break; 847 + case DEVWD_4: 848 + ret *= 2; 849 + case DEVWD_8: 850 + ret *= 2; 851 + case DEVWD_16: 852 + break; 851 853 } 852 854 if ((ddrctl & 0xc000) == 0x4000) 853 855 ret *= 2; 856 + return ret; 857 + #elif defined(CONFIG_BF60x) 858 + u32 ddrctl = bfin_read_DDR0_CFG(); 859 + int ret; 860 + switch (ddrctl & 0xf00) { 861 + case DEVSZ_64: 862 + ret = 64 / 8; 863 + break; 864 + case DEVSZ_128: 865 + ret = 128 / 8; 866 + break; 867 + case DEVSZ_256: 868 + ret = 256 / 8; 869 + break; 870 + case DEVSZ_512: 871 + ret = 512 / 8; 872 + break; 873 + case DEVSZ_1G: 874 + ret = 1024 / 8; 875 + break; 876 + case DEVSZ_2G: 877 + ret = 2048 / 8; 878 + break; 879 + } 854 880 return ret; 855 881 #endif 856 882 BUG(); ··· 892 864 { 893 865 u32 mmr; 894 866 unsigned long sclk, cclk; 867 + struct clk *clk; 895 868 896 869 native_machine_early_platform_add_devices(); 897 870 898 871 enable_shadow_console(); 899 872 900 873 /* Check to make sure we are running on the right processor */ 874 + mmr = bfin_cpuid(); 901 875 if (unlikely(CPUID != bfin_cpuid())) 902 876 printk(KERN_ERR "ERROR: Not running on ADSP-%s: unknown CPUID 0x%04x Rev 0.%d\n", 903 877 CPU, bfin_cpuid(), bfin_revid()); ··· 920 890 921 891 memset(&bfin_memmap, 0, sizeof(bfin_memmap)); 922 892 893 + #ifdef CONFIG_BF60x 894 + /* Should init clock device before parse command early */ 895 + clk_init(); 896 + #endif 923 897 /* If the user does not specify things on the command line, use 924 898 * what the bootloader set things up as 925 899 */ ··· 938 904 939 905 memory_setup(); 940 906 907 + #ifndef CONFIG_BF60x 941 908 /* Initialize Async memory banks */ 942 909 bfin_write_EBIU_AMBCTL0(AMBCTL0VAL); 943 910 bfin_write_EBIU_AMBCTL1(AMBCTL1VAL); ··· 948 913 bfin_write_EBIU_MODE(CONFIG_EBIU_MODEVAL); 949 914 bfin_write_EBIU_FCTL(CONFIG_EBIU_FCTLVAL); 950 915 #endif 916 + #endif 951 917 #ifdef CONFIG_BFIN_HYSTERESIS_CONTROL 952 918 bfin_write_PORTF_HYSTERESIS(HYST_PORTF_0_15); 953 919 bfin_write_PORTG_HYSTERESIS(HYST_PORTG_0_15); ··· 957 921 ~HYST_NONEGPIO_MASK) | HYST_NONEGPIO); 958 922 #endif 959 923 924 + #ifdef CONFIG_BF60x 925 + clk = clk_get(NULL, "CCLK"); 926 + if (!IS_ERR(clk)) { 927 + cclk = clk_get_rate(clk); 928 + clk_put(clk); 929 + } else 930 + cclk = 0; 931 + 932 + clk = clk_get(NULL, "SCLK0"); 933 + if (!IS_ERR(clk)) { 934 + sclk = clk_get_rate(clk); 935 + clk_put(clk); 936 + } else 937 + sclk = 0; 938 + #else 960 939 cclk = get_cclk(); 961 940 sclk = get_sclk(); 941 + #endif 962 942 963 943 if ((ANOMALY_05000273 || ANOMALY_05000274) && (cclk >> 1) < sclk) 964 944 panic("ANOMALY 05000273 or 05000274: CCLK must be >= 2*SCLK"); ··· 990 938 printk(KERN_INFO "Hardware Trace %s and %sabled\n", 991 939 (mmr & 0x1) ? "active" : "off", 992 940 (mmr & 0x2) ? "en" : "dis"); 993 - 941 + #ifndef CONFIG_BF60x 994 942 mmr = bfin_read_SYSCR(); 995 943 printk(KERN_INFO "Boot Mode: %i\n", mmr & 0xF); 996 944 ··· 1032 980 printk(KERN_INFO "Recovering from Watchdog event\n"); 1033 981 else if (_bfin_swrst & RESET_SOFTWARE) 1034 982 printk(KERN_NOTICE "Reset caused by Software reset\n"); 1035 - 983 + #endif 1036 984 printk(KERN_INFO "Blackfin support (C) 2004-2010 Analog Devices, Inc.\n"); 1037 985 if (bfin_compiled_revid() == 0xffff) 1038 986 printk(KERN_INFO "Compiled for ADSP-%s Rev any, running on 0.%d\n", CPU, bfin_revid()); ··· 1112 1060 1113 1061 /* Get the input clock frequency */ 1114 1062 static u_long cached_clkin_hz = CONFIG_CLKIN_HZ; 1063 + #ifndef CONFIG_BF60x 1115 1064 static u_long get_clkin_hz(void) 1116 1065 { 1117 1066 return cached_clkin_hz; 1118 1067 } 1068 + #endif 1119 1069 static int __init early_init_clkin_hz(char *buf) 1120 1070 { 1121 1071 cached_clkin_hz = simple_strtoul(buf, NULL, 0); ··· 1129 1075 } 1130 1076 early_param("clkin_hz=", early_init_clkin_hz); 1131 1077 1078 + #ifndef CONFIG_BF60x 1132 1079 /* Get the voltage input multiplier */ 1133 1080 static u_long get_vco(void) 1134 1081 { ··· 1152 1097 cached_vco *= msel; 1153 1098 return cached_vco; 1154 1099 } 1100 + #endif 1155 1101 1156 1102 /* Get the Core clock */ 1157 1103 u_long get_cclk(void) 1158 1104 { 1105 + #ifdef CONFIG_BF60x 1106 + struct clk *cclk; 1107 + u_long cclk_rate; 1108 + 1109 + cclk = clk_get(NULL, "CCLK"); 1110 + if (IS_ERR(cclk)) 1111 + return 0; 1112 + 1113 + cclk_rate = clk_get_rate(cclk); 1114 + clk_put(cclk); 1115 + return cclk_rate; 1116 + #else 1159 1117 static u_long cached_cclk_pll_div, cached_cclk; 1160 1118 u_long csel, ssel; 1161 1119 ··· 1188 1120 else 1189 1121 cached_cclk = get_vco() >> csel; 1190 1122 return cached_cclk; 1123 + #endif 1191 1124 } 1192 1125 EXPORT_SYMBOL(get_cclk); 1126 + 1127 + #ifdef CONFIG_BF60x 1128 + /* Get the bf60x clock of SCLK0 domain */ 1129 + u_long get_sclk0(void) 1130 + { 1131 + struct clk *sclk0; 1132 + u_long sclk0_rate; 1133 + 1134 + sclk0 = clk_get(NULL, "SCLK0"); 1135 + if (IS_ERR(sclk0)) 1136 + return 0; 1137 + 1138 + sclk0_rate = clk_get_rate(sclk0); 1139 + clk_put(sclk0); 1140 + return sclk0_rate; 1141 + } 1142 + EXPORT_SYMBOL(get_sclk0); 1143 + 1144 + /* Get the bf60x clock of SCLK1 domain */ 1145 + u_long get_sclk1(void) 1146 + { 1147 + struct clk *sclk1; 1148 + u_long sclk1_rate; 1149 + 1150 + sclk1 = clk_get(NULL, "SCLK1"); 1151 + if (IS_ERR(sclk1)) 1152 + return 0; 1153 + 1154 + sclk1_rate = clk_get_rate(sclk1); 1155 + clk_put(sclk1); 1156 + return sclk1_rate; 1157 + } 1158 + EXPORT_SYMBOL(get_sclk1); 1159 + 1160 + /* Get the bf60x DRAM clock */ 1161 + u_long get_dclk(void) 1162 + { 1163 + struct clk *dclk; 1164 + u_long dclk_rate; 1165 + 1166 + dclk = clk_get(NULL, "DCLK"); 1167 + if (IS_ERR(dclk)) 1168 + return 0; 1169 + 1170 + dclk_rate = clk_get_rate(dclk); 1171 + clk_put(dclk); 1172 + return dclk_rate; 1173 + } 1174 + EXPORT_SYMBOL(get_dclk); 1175 + #endif 1193 1176 1194 1177 /* Get the System clock */ 1195 1178 u_long get_sclk(void) 1196 1179 { 1180 + #ifdef CONFIG_BF60x 1181 + return get_sclk0(); 1182 + #else 1197 1183 static u_long cached_sclk; 1198 1184 u_long ssel; 1199 1185 ··· 1268 1146 1269 1147 cached_sclk = get_vco() / ssel; 1270 1148 return cached_sclk; 1149 + #endif 1271 1150 } 1272 1151 EXPORT_SYMBOL(get_sclk); 1273 1152
+3 -3
arch/blackfin/kernel/shadow_console.c
··· 15 15 #include <asm/irq_handler.h> 16 16 #include <asm/early_printk.h> 17 17 18 - #define SHADOW_CONSOLE_START (0x500) 19 - #define SHADOW_CONSOLE_END (0x1000) 20 - #define SHADOW_CONSOLE_MAGIC_LOC (0x4F0) 18 + #define SHADOW_CONSOLE_START (CONFIG_PHY_RAM_BASE_ADDRESS + 0x500) 19 + #define SHADOW_CONSOLE_END (CONFIG_PHY_RAM_BASE_ADDRESS + 0x1000) 20 + #define SHADOW_CONSOLE_MAGIC_LOC (CONFIG_PHY_RAM_BASE_ADDRESS + 0x4F0) 21 21 #define SHADOW_CONSOLE_MAGIC (0xDEADBEEF) 22 22 23 23 static __initdata char *shadow_console_buffer = (char *)SHADOW_CONSOLE_START;
+2 -1
arch/blackfin/mach-common/entry.S
··· 1141 1141 sti r0; 1142 1142 1143 1143 /* finish the userspace "atomic" functions for it */ 1144 - r1 = FIXED_CODE_END; 1144 + r1.l = lo(FIXED_CODE_END); 1145 + r1.h = hi(FIXED_CODE_END); 1145 1146 r2 = [sp + PT_PC]; 1146 1147 cc = r1 <= r2; 1147 1148 if cc jump .Lresume_userspace (bp);
-2
arch/blackfin/mach-common/head.S
··· 210 210 ENTRY(_real_start) 211 211 /* Enable nested interrupts */ 212 212 [--sp] = reti; 213 - 214 213 /* watchdog off for now */ 215 214 p0.l = lo(WDOG_CTL); 216 215 p0.h = hi(WDOG_CTL); 217 216 r0 = 0xAD6(z); 218 217 w[p0] = r0; 219 218 ssync; 220 - 221 219 /* Pass the u-boot arguments to the global value command line */ 222 220 R0 = R7; 223 221 call _cmdline_init;
+6 -8
arch/blackfin/mm/init.c
··· 48 48 49 49 unsigned long zones_size[MAX_NR_ZONES] = { 50 50 [0] = 0, 51 - [ZONE_DMA] = (end_mem - PAGE_OFFSET) >> PAGE_SHIFT, 51 + [ZONE_DMA] = (end_mem - CONFIG_PHY_RAM_BASE_ADDRESS) >> PAGE_SHIFT, 52 52 [ZONE_NORMAL] = 0, 53 53 #ifdef CONFIG_HIGHMEM 54 54 [ZONE_HIGHMEM] = 0, ··· 60 60 61 61 pr_debug("free_area_init -> start_mem is %#lx virtual_end is %#lx\n", 62 62 PAGE_ALIGN(memory_start), end_mem); 63 - free_area_init(zones_size); 63 + free_area_init_node(0, zones_size, 64 + CONFIG_PHY_RAM_BASE_ADDRESS >> PAGE_SHIFT, NULL); 64 65 } 65 66 66 67 asmlinkage void __init init_pda(void) ··· 75 74 undefined at the time of the call, we are only setting up 76 75 valid pointers to it. */ 77 76 memset(&cpu_pda[cpu], 0, sizeof(cpu_pda[cpu])); 78 - 79 - cpu_pda[0].next = &cpu_pda[1]; 80 - cpu_pda[1].next = &cpu_pda[0]; 81 77 82 78 #ifdef CONFIG_EXCEPTION_L1_SCRATCH 83 79 cpu_pda[cpu].ex_stack = (unsigned long *)(L1_SCRATCH_START + \ ··· 107 109 totalram_pages = free_all_bootmem(); 108 110 109 111 reservedpages = 0; 110 - for (tmp = 0; tmp < max_mapnr; tmp++) 112 + for (tmp = ARCH_PFN_OFFSET; tmp < max_mapnr; tmp++) 111 113 if (PageReserved(pfn_to_page(tmp))) 112 114 reservedpages++; 113 - freepages = max_mapnr - reservedpages; 115 + freepages = max_mapnr - ARCH_PFN_OFFSET - reservedpages; 114 116 115 117 /* do not count in kernel image between _rambase and _ramstart */ 116 118 reservedpages -= (_ramstart - _rambase) >> PAGE_SHIFT; ··· 125 127 printk(KERN_INFO 126 128 "Memory available: %luk/%luk RAM, " 127 129 "(%uk init code, %uk kernel code, %uk data, %uk dma, %uk reserved)\n", 128 - (unsigned long) freepages << (PAGE_SHIFT-10), _ramend >> 10, 130 + (unsigned long) freepages << (PAGE_SHIFT-10), (_ramend - CONFIG_PHY_RAM_BASE_ADDRESS) >> 10, 129 131 initk, codek, datak, DMA_UNCACHED_REGION >> 10, (reservedpages << (PAGE_SHIFT-10))); 130 132 } 131 133