ATMEL Mega1284P evaluation board avalible

There are five important pin types for SPI on an avr processor. These are SS, SCK, MISO, MOSI, and chip select.

On the 1284P these definitions must map like this

uint8_t const SS_PIN   = <pin number for PB4>;
uint8_t const MOSI_PIN = <pin number for PB5>;
uint8_t const MISO_PIN = <pin number for PB6>;
uint8_t const SCK_PIN  = <pin number for PB7>;

SS is not the same as chip select and must be defined as above. For SPI to work correctly on an avr, SS must be either set to output mode or held high in input mode http://atmel.com/dyn/resources/prod_documents/doc2585.pdf.

SdFat sets SS to output mode even if SS is not chip select.

Chip select for a SPI device can be any pin. SdFat uses SS by default:

/** The default chip select pin for the SD card is SS. */
uint8_t const  SD_CHIP_SELECT_PIN = SS_PIN;

The above definition is only used when the chip select pin is not specified in the init() call.

The definitions for this array must match the way you setup The Arduino pins_arduino.c and pins_arduino.h files.

static const pin_map_t digitalPinMap[] = {

These definitions are currently used for software SPI in SdFat and other libraries associated with SdFat.