atmega1284p/pu

1284-PU has signature bytes 0x1E 0x97 0x06
1284P-PU has signature bytes 0x1E 0x97 0x05

Find your copy of avrdude.conf, and copy the '1284P section, excerpted here:

#------------------------------------------------------------
# ATmega1284P
#------------------------------------------------------------

# similar to ATmega164p

part
    id               = "m1284p";
    desc             = "ATMEGA1284P";
    has_jtag         = yes;
    stk500_devcode   = 0x82; # no STK500v1 support, use the ATmega16 one
    avr910_devcode   = 0x74;
    signature        = 0x1e 0x97 0x05;
    pagel            = 0xd7;
    bs2              = 0xa0;
    chip_erase_delay = 9000;

and edit it to take out the P from 1284P and change the signature bytes.

Then, do the same in boards.txt for 1284 vs 1284P.