Yes you can. :)
The LE advertising packet has a field for arbitrary data in EIR format (look in the bluetooth spec for details). The packet always contains the RSSI value, though, and you can't remove that.
As for modifying the CC2540, you may have to use the IAR compiler to modify the firmware. There may be some specific cases where you can make the change without the compiler, but you didn't specify what device you had. If it's the SensorTag, you may be able to modify it without the IAR compiler, but you'd have to look that up yourself on their wiki.